- Strictly follow http://www.python.org/dev/peps/pep-0008/ if not specified otherwise.
- Consistency at first! Look at the code around and try to produce something similar.
We have a very nice SIO2 Coding Style Cheat Sheet for you to print!
- Do not use accessor methods (set_something, get_something). Use @property instead.
- Docstring: single-paragraph docstrings look like this:
- Docstring: multiple-paragraph look like this:
- Docstring: class
- Text which may be translated in the future must be in double quotes. Of course, use _("some text") if it makes sense. Some modules do not support it yet — leave double quotes in this case.
- Do not specify encoding of Python file if not needed. If needed, always use utf8.
- Do not forget to escape content which may contain special characters in Jinja templates.