Zubax coding conventions for Python inherit the PEP8 almost verbatim, with the following list of minor deviations and a small set of additional requirements.
Static type checking
All functions and global objects must be type annotated. Types must be checked statically using MyPy with the following (or stricter) settings (example shown is an excerpt from
All new code should be written for Python 3.6 or newer.
Support for older versions of Python is optional. Support for Python 2.x is discouraged.
All public functions, classes, and variables should be documented, unless they are simple enough for their purpose to be evident.
An example that shows the adopted documentation convention is provided below.
The maximum length of line is set to 120 characters. This is unlike PEP8, where the limit is set to 79 characters.
Trailing whitespaces are not allowed. PEP8 provides a weak recommendation to avoid whitespaces, too.
Usage of tabs is not allowed. If you're porting an existing codebase, replace all tabs with 4 spaces. PEP8 recommends to retain tabs when working with an existing codebase.
Every text file should contain exactly one empty line at the end.
Allowed end-of-line character sequence is Unix-style (
\n, LF). Windows or Mac line endings are not allowed.
The recommended IDE for Python development is JetBrains PyCharm IDE.