Title: descrintro: error describing __new__ behavior
Type: Stage:
Components: Documentation Versions:
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: bethard, georg.brandl, ggenellina
Priority: normal Keywords:

Created on 2007-03-23 09:47 by ggenellina, last changed 2007-08-24 06:19 by georg.brandl. This issue is now closed.

Messages (5)
msg31634 - (view) Author: Gabriel Genellina (ggenellina) Date: 2007-03-23 09:47
descrintro ( linked from 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.

msg31635 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2007-04-03 21:47
Note that this is correct in the documentation:
msg31636 - (view) Author: Gabriel Genellina (ggenellina) Date: 2007-04-05 05:00
Yes, but descrintro is the very first reference under "and should be your starting point." (citing that page)

Surely there are other documents a bit outdated, but being descrintro in such a prominent place, should have a correct content.
msg31637 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2007-04-05 07:52
Sorry, I wasn't suggesting that it shouldn't be corrected.  Only that there's already text available to correct it in the Reference.
msg55244 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-08-24 06:19
Fixed in pydotorg rev. 10972.
Date User Action Args
2007-08-24 06:19:26georg.brandlsetstatus: open -> closed
assignee: georg.brandl
resolution: fixed
messages: + msg55244
nosy: + georg.brandl
2007-03-23 09:47:15ggenellinacreate