It is legal, but you had better make sure that (whatever) becomes false somewhere along the line, as a side-effect of foo::__init__. Otherwise, I pity the foo at the bottom, who has to carry an entire heap full of bars. (okay,okay) >class foo: > def __init__(self, x): > if (whatever): > self.bar = foo(y)