-
Notifications
You must be signed in to change notification settings - Fork 61
Coding GuideLines
Piyush Parkash edited this page Jun 9, 2014
·
5 revisions
###How to write code?
PEP8 coding standards for python:
- 4 spaces Indentation per level.
- No mix of tabs or spaces, convert tabs to spaces.
- Maximum length of 79 characters.
- For docstrings or comments, line length of 72 characters.
- 2 blank lines between classes and top level functions.
- Single blank line between functions inside a class.
- Imports on separate lines.
- Blank line between each group of imports.
- Whitespace between operands.
- No whitespace in parameter values.
- Each line of a block comment starts with a # and a single space (unless it is indented text inside the comment). Paragraphs inside a block comment are separated by a line containing a single #.
- Never use the characters 'l', 'O', or 'I' as single character variable names.
- Package and module names: all-lowercase names, with words separated by underscores.
- Class names: CapWords convention.
- Use one leading underscore only for non-public methods and instance variables.
- Constants written in all capital letters with underscores separating words.