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

Python Coding Style Guidelines

1 mins


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.