Skip to content

Python Coding Style

Olivier Michel edited this page Jan 16, 2023 · 3 revisions

#CS100 → #CS199 Python

#CS100 Use PEP8

When not specified otherwise by our coding style rules, use the PEP 8 standard. Note: using Atom with the linter-flake8 linter package ensures that we respect our Python coding styles: apm install linter-flake8.

On VSCode, you can install the PEP8 flake8 linter: settings.json

    "python.linting.flake8Enabled": true,
    "python.linting.enabled": true,

#CS101 Don't exceed 128 character for line of code

Line size is limited to 128 characters (instead of 80 in PEP8). In VSCode, you can add this to your settings.json:

    "python.linting.flake8Args": [
        "--max-line-length",
        "128"
    ],
    "python.formatting.autopep8Args": [
        "--max-line-length",
        "128"
    ],

#CS102 Don't use PEP257 comments on all functions

We don't force PEP257 comments on all functions (especially, simple constructors, getters, setters, etc.) and therefore don't use the flake8-docstrings Atom package. However, we strongly encourage to respect this rule when it makes sense.

Clone this wiki locally