diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-11-24 10:53:45 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-11-24 10:53:45 (GMT) |
commit | c49477b1848d5f7f1a98c6f19931d75c29019c7e (patch) | |
tree | 275eebd3cfdb4667b15880767536173b351bb3c6 /Modules/_pickle.c | |
parent | 4c05d3bc561dcdd70dd0d268fa769197334349a8 (diff) | |
download | cpython-c49477b1848d5f7f1a98c6f19931d75c29019c7e.zip cpython-c49477b1848d5f7f1a98c6f19931d75c29019c7e.tar.gz cpython-c49477b1848d5f7f1a98c6f19931d75c29019c7e.tar.bz2 |
Make Ellipsis and NotImplemented picklable through the reduce protocol.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r-- | Modules/_pickle.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index f0c918f..3187555 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -3172,30 +3172,6 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name) } static int -save_ellipsis(PicklerObject *self, PyObject *obj) -{ - PyObject *str = PyUnicode_FromString("Ellipsis"); - int res; - if (str == NULL) - return -1; - res = save_global(self, Py_Ellipsis, str); - Py_DECREF(str); - return res; -} - -static int -save_notimplemented(PicklerObject *self, PyObject *obj) -{ - PyObject *str = PyUnicode_FromString("NotImplemented"); - int res; - if (str == NULL) - return -1; - res = save_global(self, Py_NotImplemented, str); - Py_DECREF(str); - return res; -} - -static int save_pers(PicklerObject *self, PyObject *obj, PyObject *func) { PyObject *pid = NULL; @@ -3552,14 +3528,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save) status = save_none(self, obj); goto done; } - else if (obj == Py_Ellipsis) { - status = save_ellipsis(self, obj); - goto done; - } - else if (obj == Py_NotImplemented) { - status = save_notimplemented(self, obj); - goto done; - } else if (obj == Py_False || obj == Py_True) { status = save_bool(self, obj); goto done; |