diff options
author | Furkan Önder <furkantahaonder@gmail.com> | 2020-04-18 18:09:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 18:09:09 (GMT) |
commit | 482259d0dcf27714a84cf56b93977320bea7e093 (patch) | |
tree | db3bfa928687a5a73c552ba128e87044a94d7216 /Doc/library/pickle.rst | |
parent | 696136b993e11b37c4f34d729a0375e5ad544ade (diff) | |
download | cpython-482259d0dcf27714a84cf56b93977320bea7e093.zip cpython-482259d0dcf27714a84cf56b93977320bea7e093.tar.gz cpython-482259d0dcf27714a84cf56b93977320bea7e093.tar.bz2 |
bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269)
Automerge-Triggered-By: @pitrou
Diffstat (limited to 'Doc/library/pickle.rst')
-rw-r--r-- | Doc/library/pickle.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst index 779b60e..a7b92bb 100644 --- a/Doc/library/pickle.rst +++ b/Doc/library/pickle.rst @@ -639,9 +639,9 @@ the methods :meth:`__getstate__` and :meth:`__setstate__`. At unpickling time, some methods like :meth:`__getattr__`, :meth:`__getattribute__`, or :meth:`__setattr__` may be called upon the instance. In case those methods rely on some internal invariant being - true, the type should implement :meth:`__getnewargs__` or - :meth:`__getnewargs_ex__` to establish such an invariant; otherwise, - neither :meth:`__new__` nor :meth:`__init__` will be called. + true, the type should implement :meth:`__new__` to establish such an + invariant, as :meth:`__init__` is not called when unpickling an + instance. .. index:: pair: copy; protocol |