Some persistent picklers (well, probably, the *only* persistent
pickler) would like to pickle some classes in a special way.
try:
f = self.dispatch[t]
except KeyError:
+ pid = self.inst_persistent_id(object)
+ if pid is not None:
+ self.save_pers(pid)
+ return
+
try:
issc = issubclass(t, TypeType)
except TypeError: # t is not a class
self.save_global(object)
return
- pid = self.inst_persistent_id(object)
- if pid is not None:
- self.save_pers(pid)
- return
-
try:
reduce = dispatch_table[t]
except KeyError:
}
}
- if (PyType_IsSubtype(type, &PyType_Type)) {
- res = save_global(self, args, NULL);
- goto finally;
- }
-
if (!pers_save && self->inst_pers_func) {
if ((tmp = save_pers(self, args, self->inst_pers_func)) != 0) {
res = tmp;
}
}
+ if (PyType_IsSubtype(type, &PyType_Type)) {
+ res = save_global(self, args, NULL);
+ goto finally;
+ }
+
if ((__reduce__ = PyDict_GetItem(dispatch_table, (PyObject *)type))) {
Py_INCREF(__reduce__);