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
Paragraph P1 recommends cls for any variable or argument known to be a class. Paragraph P2 states that class_ is better than clss.
I think that P2 can mislead users to think that class_ is generally the preferred naming for a class (even if strictly speaking P1 and P2 are not contradictory and mean that cls > class_ > clss).
In P2, I suggest to replace
class_ is better than clss
by
async_ is better than asynk
or, to match the previous enumeration "is preferable to an abbreviation or corrupted spelling"
async_ is better than asnc or asynk
I chose async because of its high use frequency mentioned here.
Other replacement options:
If your public attribute name collides with a reserved keyword, append a single trailing underscore to your attribute name. This is preferable to an abbreviation or corrupted spelling. (However, notwithstanding this rule, ‘cls’ is the preferred spelling for any variable or argument which is known to be a class, especially the first argument to a class method.)
If a function argument’s name clashes with a reserved keyword, it is generally better to append a single trailing underscore rather than use an abbreviation or spelling corruption. Thus class_ is better than clss.
The text was updated successfully, but these errors were encountered:
I'm not sure there's strictly a need for a change here, indeed as you note the paragraphs are not contradictory, but illustrate different points with similar examples.
I agree with @AA-Turner. Thanks for pointing this out @templiert. I would recommend we close this issue and the issue itself can serve as future guidance if there is any confusion. ☀️
Paragraph P1 recommends
cls
for any variable or argument known to be a class.Paragraph P2 states that
class_
is better thanclss
.I think that P2 can mislead users to think that
class_
is generally the preferred naming for a class (even if strictly speaking P1 and P2 are not contradictory and mean thatcls
>class_
>clss
).In P2, I suggest to replace
by
or, to match the previous enumeration "is preferable to an abbreviation or corrupted spelling"
I chose async because of its high use frequency mentioned here.
Other replacement options:
P1
P2
The text was updated successfully, but these errors were encountered: