This code produces an error message, which I found surprising:
class Foo(object): custom = 1 def __init__(self, custom=Foo.custom): self._custom
What we do instead is the following
class Foo( object ): custom = 1 def __init__( self, arg=None ) self._custom = self.custom if arg is None else arg
This bypasses the confusing issue of whether or not the name Foo has been defined yet.
Foo