You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of single uppercase letter variables is pretty widespread in some applications, namely those that are more math-oriented. For example, X is a common variable name given to a matrix, G for graphs, etc.
My understanding of PEP8 is that these are specifically allowed (see Names to avoid), but also not specifically disallowed in the more relevant Function and method arguments section, which lists only N804 and N805.
The text was updated successfully, but these errors were encountered:
Never use the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), or 'I' (uppercase letter eye) as single character variable names.
I would say it's a misinterpretation that it explicitly disallowing single upper case variable names for certain letters, is it implicitly allowing of other letters as upper case to be used as variables.
I think the case where the cited reason comes into effect are cases like class E: (allowed) vs class I: (disallowed).
Instead of special-casing single letters for this specific use case, unless there's good evidence that this is a really common naming pattern, I think we should recommend:
--ignore-names for code bases where X and G like OP suggested are common.
use per-line disabling like X = 3 # noqa: N806 in codebases where it is uncommon
The use of single uppercase letter variables is pretty widespread in some applications, namely those that are more math-oriented. For example,
X
is a common variable name given to a matrix,G
for graphs, etc.My understanding of PEP8 is that these are specifically allowed (see Names to avoid), but also not specifically disallowed in the more relevant Function and method arguments section, which lists only
N804
andN805
.The text was updated successfully, but these errors were encountered: