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 thanasnc
orasynk
I chose async because of its high use frequency mentioned here.
Other replacement options:
continue_
is better thanctn
orkontinue
break_
is better thanbrk
orbreac
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
.
Activity