Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
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" ---------- nosy: +belopolsky _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6477> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com