-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
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 thanclss
by
async_is better thanasynk
or, to match the previous enumeration "is preferable to an abbreviation or corrupted spelling"
async_is better thanasncorasynk
I chose async because of its high use frequency mentioned here.
Other replacement options:
continue_is better thanctnorkontinue
break_is better thanbrkorbreac
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 thanclss.