Naming of modules, classes, methods and variables in python #16
AndrewSazonov
announced in
ADRs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For code consistency use PEP-8 style where the most important conventions are:
Module
Name should always be snake_small_caps (file tree)
root_folder.first_folder
dandy_fine
and minusnever-ever
. Python will give strange errorsClass
Name should be CamelCase for the individual words.
BestClassEver
If acronym is part of the name it should be ALLCAPS
SWATCodeIsTheBest
Methods and variables
Public methods and variables should be snake_small_caps.
Private methods and variables should have a leading underscore _private_method
Assume we have initialized an object of the
MyClass
:Links to the original discussions: #13
Beta Was this translation helpful? Give feedback.
All reactions