mirror of
https://github.com/python/cpython
synced 2024-10-14 12:48:09 +00:00
bpo-15542: Documentation incorrectly suggests __init__ called after direct __new__ call (GH-15478)
This commit is contained in:
parent
1039f39c9c
commit
6b16d938d6
|
@ -1166,10 +1166,10 @@ Basic customization
|
||||||
with appropriate arguments and then modifying the newly-created instance
|
with appropriate arguments and then modifying the newly-created instance
|
||||||
as necessary before returning it.
|
as necessary before returning it.
|
||||||
|
|
||||||
If :meth:`__new__` returns an instance of *cls*, then the new instance's
|
If :meth:`__new__` is invoked during object construction and it returns an
|
||||||
:meth:`__init__` method will be invoked like ``__init__(self[, ...])``, where
|
instance or subclass of *cls*, then the new instance’s :meth:`__init__` method
|
||||||
*self* is the new instance and the remaining arguments are the same as were
|
will be invoked like ``__init__(self[, ...])``, where *self* is the new instance
|
||||||
passed to :meth:`__new__`.
|
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
|
If :meth:`__new__` does not return an instance of *cls*, then the new instance's
|
||||||
:meth:`__init__` method will not be invoked.
|
:meth:`__init__` method will not be invoked.
|
||||||
|
|
Loading…
Reference in a new issue