[style, code, python, best practices, guidelines]


Python coding style guidelines

PEP 8

We follow Python’s style guide PEP 8. Also we:

  • Use docstrings for functions whose purpose may be unclear or that will be used outside of their own modules

Supplemental resources:

Additional notes:

  • When opening text files for writing or appending text, use open’s option mode = "wb" or mode = "ab" respectively to write in binary mode. This improves portability across operating systems.

  • When opening text files for reading, use open’s option mode = "rU" to enable universal newline support.