-
Notifications
You must be signed in to change notification settings - Fork 27
Coding Style Guidelines
The goal of this style guide is to help produce clear, consistent and correct Python code. We have based our guidelines on the Google Python Style Guidelines which are themselves based on PEP 8.
In Python 3, classes implicitly inherit from object, so there is no need to do this explicitly.
In classes that maintain no invariants, use public instance variables, and do not write accessor (getter/setter) methods.
In classes that maintain one or more invariants, use a single underscore to mark data as private. While this is only a notational indication, not enforced by the Python interpreter, it makes it clear to the user what is intended for use outside the class, and what is not.
USE
from decisionengine.framework.dataspace import dataspace
NOT
import decisionengine.framework.dataspace as dataspace
and NEVER
from decisionengine.framework.dataspace import *
if foo :
baz()
for _ in range(10):
baz()
rather than:
if foo: baz()
for _ in range(10): baz()
CamelStyle class names. If class name should contain an acronym capitalize only the first letter, like so:
class GceBillingCalculator
PRODUCES = ["Gce_Burn_Rate"]