[issue35933] python doc does not say that the state kwarg in Pickler.save_reduce can be a tuple (and not only a dict)

Serhiy Storchaka report at bugs.python.org
Wed Feb 20 10:31:31 EST 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

A slotted class will have a dict also when it inherits it from a non-slotted class. This is why the base class of slotted class should have slots if you do not want an instance dict.

__getstate__ and __setstate__ for slotted classes are described in PEP 307. Unfortunately this was not copied to the module documentation.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35933>
_______________________________________


More information about the Python-bugs-list mailing list