Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

descrintro: error describing __new__ behavior #44768

Closed
ggenellina mannequin opened this issue Mar 23, 2007 · 5 comments
Closed

descrintro: error describing __new__ behavior #44768

ggenellina mannequin opened this issue Mar 23, 2007 · 5 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@ggenellina
Copy link
Mannequin

ggenellina mannequin commented Mar 23, 2007

BPO 1686597
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2007-08-24.06:19:26.922>
created_at = <Date 2007-03-23.09:47:15.000>
labels = ['docs']
title = 'descrintro: error describing __new__ behavior'
updated_at = <Date 2007-08-24.06:19:26.891>
user = 'https://bugs.python.org/ggenellina'

bugs.python.org fields:

activity = <Date 2007-08-24.06:19:26.891>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2007-08-24.06:19:26.922>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2007-03-23.09:47:15.000>
creator = 'ggenellina'
dependencies = []
files = []
hgrepos = []
issue_num = 1686597
keywords = []
message_count = 5.0
messages = ['31634', '31635', '31636', '31637', '55244']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'ggenellina', 'bethard']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1686597'
versions = []

@ggenellina
Copy link
Mannequin Author

ggenellina mannequin commented Mar 23, 2007

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 bpo-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.

@ggenellina ggenellina mannequin added docs Documentation in the Doc dir labels Mar 23, 2007
@bethard
Copy link
Mannequin

bethard mannequin commented Apr 3, 2007

Note that this is correct in the documentation: http://docs.python.org/ref/customization.html

@ggenellina
Copy link
Mannequin Author

ggenellina mannequin commented Apr 5, 2007

Yes, but descrintro is the very first reference under http://www.python.org/doc/newstyle/ "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.

@bethard
Copy link
Mannequin

bethard mannequin commented Apr 5, 2007

Sorry, I wasn't suggesting that it shouldn't be corrected. Only that there's already text available to correct it in the Reference.

@birkenfeld
Copy link
Member

Fixed in pydotorg rev. 10972.

@birkenfeld birkenfeld self-assigned this Aug 24, 2007
@birkenfeld birkenfeld self-assigned this Aug 24, 2007
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant