Constructor documentation assigned to class or __init__?
Leif K-Brooks
eurleif at ecritters.biz
Wed Jun 16 22:33:21 EDT 2004
Should a class's constructor be documented in the class's docstring or
__init__'s docstring? For instance:
class Foo(object):
"""This class represents mating lizards. Constructor requires one
argument, the lizard this lizard is mating with."""
def __init__(self, other):
pass
# or
class Bar(object):
""This class represents mating lizards."""
def __init__(self, other):
"""Initiate the object. Requires one argument, "other", which is the
lizard this lizard is mating with."""
pass
More information about the Python-list
mailing list