Nick Coghlan <ncogh...@gmail.com> added the comment: Given that dumps(type(Ellipsis)) and dumps(type(NotImplemented)) don't work either, I am reclassifying this as a documentation bug.
The thing about the types of these three objects (None, Ellipsis, NotImplemented) is that they are all designed to be singletons and they all disallow creation of new instances of them. >>> type(None)() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'NoneType' instances >>> type(NotImplemented)() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'NotImplementedType' instances >>> type(Ellipsis)() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'ellipsis' instances This does mean None has to be special cased if pickling "(object, type(object))" pairs, but passing types through pickle strikes me as a dubious enough exercise that it would take a fairly convincing use case to accept an RFE to make NoneType pickleable (note that any such patch would have to make sure that doing loads() on such a pickle didn't manage to create a second copy of NoneType or None). ---------- assignee: -> georg.brandl components: +Documentation -Library (Lib) nosy: +georg.brandl, ncoghlan _______________________________________ 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