-
Notifications
You must be signed in to change notification settings - Fork 19
Coding Style
Man-Long Wong edited this page Jul 3, 2017
·
20 revisions
We use Python 2 as the programming language for the core modules.
It is recommended to use:
-
UpperCamelCase
for class names -
lowerCamelCase
for methods and functions -
CAPITALIZED_WITH_UNDERSCORES
for constants -
lowercase_separated_by_underscores
for variable names -
lowercase_separated_by_underscores
for python file names -
UpperCamelCase
for names of Jupyter Notebook example scripts
4 spaces of indentation, and no tab characters should be used.
Triple quote format is preferred for docstring that appears as first statement in classes, methods or functions.
A single line above the code is recommended. Add full stop at the end of each comment.
Use two empty lines between def
's.
Use single underscore _private
to indicate that attribute or method are for internal use in class.
- User Guide
- Tutorials