Wemake-python-styleguide: Forbid to use `lI` names

Created on 26 Feb 2020  路  11Comments  路  Source: wemake-services/wemake-python-styleguide

Rule request

Thesis

Currently one can name your classes like so: ControlIn
And it is unreadable! Inside it is just L and i, but we cannot tell it from the word.

We need to forbid lowercase l followed by uppercase I

Reasoning

Readability matters!

help wanted starter pr-merged rule request

Most helpful comment

We don't have warnings. Errors are better!

All 11 comments

Are there any other letters that behave like that?

  • digit 1: Fill1List.
  • digit 0 and letter o: Memo0Output
  • Obviously, same letters in reverse order, Il.

Also there are letters (Unicode codepoints) which are different but look just the same.
For example, there's Latin A, Greek , Cyrillic .

But actually, let's just ban any letters outside the standard ASCII set. Anything which requires using non-English keyboard layout, anything which has modifiers. And emojis. Emojis are the worst.

Thanks!

  • I (i uppercase) and l (L lowercase) should be banned too!
  • We have already banned all unicode chars in variable names.
  • Can you please tell more about 1? It does not look similar to l or L
  • What about o and 0 and O?

l1I and 0O are distinguishable, but still risky. Probably, a warning?

We don't have warnings. Errors are better!

Anyone is working on this?

No, @kennycontreras feel free to take this one! Ask any questions you have.

Hi. Could I take the issue?

@Kvm99 Yes please, I don't have much time at the moment so I'll leave it for now.

@kennycontreras no worries, come back when you will have the time! 馃憤

@Kvm99 thanks a lot! Assigned!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sobolevn picture sobolevn  路  3Comments

sobolevn picture sobolevn  路  5Comments

orsinium picture orsinium  路  3Comments

vnmabus picture vnmabus  路  4Comments

hangtwenty picture hangtwenty  路  5Comments