Skip to content

Commit

Permalink
bpo-15542: Documentation incorrectly suggests __init__ called after d…
Browse files Browse the repository at this point in the history
…irect __new__ call (pythonGH-15478)
  • Loading branch information
nanjekyejoannah authored and rhettinger committed Aug 26, 2019
1 parent 1039f39 commit 6b16d93
Showing 1 changed file with 4 additions and 4 deletions.
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
: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 comments on commit 6b16d93

Please sign in to comment.