Felix Wiemann wrote:
Steven Bethard wrote:


Felix Wiemann wrote:


How can I prevent __init__ from being called on the
already-initialized object?

The short answer: you can't: http://www.python.org/2.2.3/descrintro.html#__new__

[snip]
This prompts a similar query. __new__ appears to be intended for immutable objects but it seems to be called as part of constructor process for all instances.


Regarding the original question. It is not possible to prevent the use of __init__ but is it possible to prevent __init__ having any effect by setting a flag when __init__ is called for the first creation of the instance.

Colin W.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to