File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,15 @@ Pickling and unpickling normal class instances
458458 For :term: `new-style class `\e s, if :meth: `__getstate__ ` returns a false
459459 value, the :meth: `__setstate__ ` method will not be called.
460460
461+ .. note ::
462+
463+ At unpickling time, some methods like :meth: `__getattr__ `,
464+ :meth: `__getattribute__ `, or :meth: `__setattr__ ` may be called upon the
465+ instance. In case those methods rely on some internal invariant being
466+ true, the type should implement either :meth: `__getinitargs__ ` or
467+ :meth: `__getnewargs__ ` to establish such an invariant; otherwise, neither
468+ :meth: `__new__ ` nor :meth: `__init__ ` will be called.
469+
461470
462471Pickling and unpickling extension types
463472^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments