Recursive constructors?
Fredrik Lundh
fredrik at pythonware.com
Fri Jul 30 13:54:28 EDT 1999
More information about the Python-list mailing list
Fri Jul 30 13:54:28 EDT 1999
- Previous message (by thread): Recursive constructors?
- Next message (by thread): Recursive constructors?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Roy Smith <roy at popmail.med.nyu.edu> wrote: > Is it legal for a constructor function to call itself recursively? I.e.: > > class foo: > def __init__(self, x): > if (whatever): > self.bar = foo(y) why not just try it? ;-) (hint: the class statement will finish before you get around to actually create an in- stance of the class, and at that time, 'foo' is already in the GLOBAL namespace). </F>
- Previous message (by thread): Recursive constructors?
- Next message (by thread): Recursive constructors?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list