This may be a stupid / trivial question, but I'm confused in this matter.
What is the encouraged (pythonic) way of declaring instance fields - in the constructor, or in the class body itself?
class Foo:
""" Foo class """
# While we are at it, how to properly document the fields?
bar = None
def __init__(self, baz):
""" Make a Foo """
self.bar = baz
OR:
class Foo:
""" Foo class """
def __init__(self, baz):
""" Make a Foo """
self.bar = baz