Message336105
I added a PR with a small patch to document this behavior and reconcile _pickle.c and pickle.py
Some explanations on why I am pushing this forward:
Pickling instances of classes/subclasses with slots is done natively for pickle protocol >= 2. Mentioning this behavior in the docs should *not* make the user worry about implementing custom __getstate__ methods just to preserve slots.
Here is the reason why I think this functionality (allowing state and slotstate) is worth documenting: pickle gives us a lot of flexibility for reducing thanks to the dispatch_table. But unpickling is rather rigid: if no __setstate__ exists, we have to deal with the default state updating procedure present in load_build. Might as well document all of it ;) |
|
Date |
User |
Action |
Args |
2019-02-20 15:41:42 | pierreglaser | set | recipients:
+ pierreglaser, rhettinger, pitrou, alexandre.vassalotti, docs@python, serhiy.storchaka |
2019-02-20 15:41:42 | pierreglaser | set | messageid: <1550677302.32.0.102296500976.issue35933@roundup.psfhosted.org> |
2019-02-20 15:41:42 | pierreglaser | link | issue35933 messages |
2019-02-20 15:41:42 | pierreglaser | create | |
|