-
Notifications
You must be signed in to change notification settings - Fork 5
Style Guide
Tomáš Effenberger edited this page Oct 2, 2015
·
1 revision
Try to stick with Google Python Style Guide.
Docstring format for functions:
def some_function(foo, bar=None):
"""Short description.
Detailed description of the function...
Args:
foo: Some description.
bar: Some description.
Returns:
What the function returns, ideally with example if it's complicated.
Raises:
IOError: When the error occurs.
"""
pass
Docstring format for classes:
class SomeClass(object):
"""Short class summary.
Detailed information about the class...
Attributes:
foo: Some description.
bar: Some description.
"""
def __init__(self, foo=True):
"""Inits SomeClass."""
self.foo = foo
self.bar = 0
TBA