Make Ellipsis and NotImplemented picklable through the reduce protocol.

This commit is contained in:
Alexandre Vassalotti 2013-11-24 02:53:45 -08:00
parent 4c05d3bc56
commit c49477b184
4 changed files with 24 additions and 42 deletions

View file

@ -633,14 +633,6 @@ class _Pickler:
self.write(NONE)
dispatch[type(None)] = save_none
def save_ellipsis(self, obj):
self.save_global(Ellipsis, 'Ellipsis')
dispatch[type(Ellipsis)] = save_ellipsis
def save_notimplemented(self, obj):
self.save_global(NotImplemented, 'NotImplemented')
dispatch[type(NotImplemented)] = save_notimplemented
def save_bool(self, obj):
if self.proto >= 2:
self.write(NEWTRUE if obj else NEWFALSE)