instantiation inside __init__
Jeff Epler
jepler at unpythonic.net
Thu Jun 3 07:54:49 EDT 2004
The reason is nearly the same that
def f():
return f()
is an endless loop (endless recursion, really)
To construct a C, C.__init__ is called. But C.__init__ always
constructs an additional C, calling C.__init__, and so on.
Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20040603/e2953b3b/attachment.sig>
More information about the Python-list
mailing list