From PEP 8 section of Function and method arguments :
Always use self for the first argument to instance methods.
Always use cls for the first argument to class methods.
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. (Perhaps better is to avoid such clashes by using a synonym.)
It does not say anything about the preferred naming style. I guess it should be "lower_case_with_underscores" or "mixedCase" but I am not sure. What is preferred?
From the PEP 8 section immediately above the one you quoted.
Function Names
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.
Link: https://www.python.org/dev/peps/pep-0008/#function-names
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With