Message265087
| Author |
serhiy.storchaka |
| Recipients |
alexandre.vassalotti, belopolsky, docs@python, eltoder, georg.brandl, pitrou, r.david.murray, serhiy.storchaka |
| Date |
2016年05月07日.19:02:41 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1462647761.59.0.692613008726.issue12290@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Actually this wording is not quite correct. __setstate__() is called for any pickled state. It is not called only if the state is not pickled. The state is not pickled if reducing method (__reduce_ex__ or __reduce__) doesn't return state or returns None as a state. Default reducing method for protocol 0 and 1 doesn't return a state if __getstate__() returns false value.
There are many other details of pickle protocol that are not correctly documented in the documentation of the pickle module. PEP 307 documents pickle protocol more correctly. |
|