diff options
author | Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> | 2019-08-26 06:53:11 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-08-26 06:53:11 (GMT) |
commit | 6b16d938d6d1ccb443815e20e8812deed274dc09 (patch) | |
tree | 39642f5afd9f43a1fa532236b314501a14679c05 /Doc/reference | |
parent | 1039f39c9c6edb4c185856c19316d3a4eb561c38 (diff) | |
download | cpython-6b16d938d6d1ccb443815e20e8812deed274dc09.zip cpython-6b16d938d6d1ccb443815e20e8812deed274dc09.tar.gz cpython-6b16d938d6d1ccb443815e20e8812deed274dc09.tar.bz2 |
bpo-15542: Documentation incorrectly suggests __init__ called after direct __new__ call (GH-15478)
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/datamodel.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 1dd8e42..d1702cc 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -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. |