Naming Conventions#
PEP8#
PEP8 is the “Style Guide for Python Code”. Reading this is good. So check the document:
But applying PEP8 is even better. To simplify the use of PEP8 many tools have been created. So use one.
pycodestyle is a tool to check your Python code against some of the style conventions in PEP 8.
A simple summary of PEP8:
Type |
Public |
Internal |
---|---|---|
Packages |
|
|
Modules |
|
|
Classes |
|
|
Exceptions |
|
|
Functions |
|
|
Global/Class Constants |
|
|
Global/Class Variables |
|
|
Instance Variables |
|
|
Method Names |
|
|
Function/Method Parameters |
|
|
Local Variables |
|