8000 bpo-15542: Documentation incorrectly suggests __init__ called after direct __new__ call by nanjekyejoannah · Pull Request #15478 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-15542: Documentation incorrectly suggests __init__ called after direct __new__ call #15478

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

Merged
merged 3 commits into from
Aug 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,10 @@ Basic customization
with appropriate arguments and then modifying the newly-created instance
as necessary before returning it.

If :meth:`__new__` returns an instance of *cls*, then the new instance's
59F8 :meth:`__init__` method will be invoked like ``__init__(self[, ...])``, where
*self* is the new instance and the remaining arguments are the same as were
passed to :meth:`__new__`.
If :meth:`__new__` is invoked during object construction and it returns an
instance or subclass of *cls*, then the new instance’s :meth:`__init__` method
will be invoked like ``__init__(self[, ...])``, where *self* is the new instance
and the remaining arguments are the same as were passed to the object constructor.

If :meth:`__new__` does not return an instance of *cls*, then the new instance's
:meth:`__init__` method will not be invoked.
Expand Down
0