This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ggenellina
Recipients
Date 2007-03-23.09:47:15
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
descrintro (http://www.python.org/download/releases/2.2.3/descrintro/#__new__) linked from http://www.python.org/doc/newstyle/ still says:

"__new__ must return an object. [...] If you return an object of a different class, its __init__ method will be called."

But since Revision 26220 - Modified Sat Apr 6 01:05:01 2002 UTC (4 years, 11 months ago) by gvanrossum:

"Changed new-style class instantiation so that when C's __new__ method returns something that's not a C instance, its __init__ is not called.  [SF bug #537450]"

That is, exactly the opposite as said on descrintro. The documentation for __new__ in the Reference manual, section 3.4.1, is correct and says: "If __new__() does not return an instance of cls, then the new instance's __init__() method will not be invoked."

Note that the modified behavior was already present on version 2.2.3 (and later) so updating the document currently at /download/releases/2.2.3/ would be fine.

History
Date User Action Args
2007-08-23 14:52:43adminlinkissue1686597 messages
2007-08-23 14:52:43admincreate