This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients alexandre.vassalotti, belopolsky, georg.brandl, hagen, july, ncoghlan
Date 2010-06-29.23:19:09
SpamBayes Score 0.0031195616
Marked as misclassified No
Message-id <1277853551.1.0.0171657175568.issue6477@psf.upfronthosting.co.za>
In-reply-to
Content
Ellipsis and NotImplemented are different from None because they are not pickleable themselves.  The None situation is more similar to that of say module level functions:


>>> def f(): pass
... 
>>> dumps(f)  # works
b'\x80\x03c__main__\nf\nq\x00.'
>>> dumps(type(f))  # does not work
Traceback (most recent call last):
  ..
_pickle.PicklingError: Can't pickle <class 'function'>: attribute lookup builtins.function failed


I think documentation at http://docs.python.org/dev/py3k/library/pickle.html#what-can-be-pickled-and-unpickled

Can be improved in two ways:

1. s/types/objects/ in "The following types can be pickled"

2. Add a note that "type(x) can be pickled" does not follow from "x can be pickled."  The object type(x) must itself fall into one on the listed categories.

3. "built-in functions defined at the top level of a module" should probably be "built-in classes or functions defined at the top level of the builtins module"

4. "instances of such classes" should be "instances of picklable classes"

5. "__setstate__() is picklable" should be "output of __getstate__() is picklable"
History
Date User Action Args
2010-06-29 23:19:11belopolskysetrecipients: + belopolsky, georg.brandl, ncoghlan, alexandre.vassalotti, hagen, july
2010-06-29 23:19:11belopolskysetmessageid: <1277853551.1.0.0171657175568.issue6477@psf.upfronthosting.co.za>
2010-06-29 23:19:10belopolskylinkissue6477 messages
2010-06-29 23:19:09belopolskycreate