-
Notifications
You must be signed in to change notification settings - Fork 13
Coding Standards
lukecampbell edited this page Nov 7, 2014
·
2 revisions
I'd like to set some standards for development so that I don't have to be like Michael and make comments on every PR.
PEP8 is good please read and follow it: http://legacy.python.org/dev/peps/pep-0008/ PEP257 another good one http://legacy.python.org/dev/peps/pep-0257/
I'm not perfect at following it but the closer we get the better our lives will be.
- I'm not a big stickler on the 80c column width but please don't go past 120c
- no tabs, only spaces, and exactly 4 spaces for indenting python code
- if the method exceeds three lines it must have a docstring
- if a body or scope is nested more than three times I will make fun of you for not splitting that up into another method
- every module should have #!/usr/bin/env python as the header line
- immediately following that should be a module doc string
- modules should be limited in scope and purpose, I will take it as a kindness if we don't have 8 classes in one module
- please don't use super, instead explicitly call the parents that you want to extend in the methods that require it.
- No relative imports, please use the full package path
- If you use relative imports, it won't work in production or on other people's machines that set PYTHONPATH, full paths always work in a proper virtual env and production
Failure will result in public humiliation, thank you for your cooperation.