Message257667
On Jan 06, 2016, at 10:13 PM, Serhiy Storchaka wrote:
>What return __reduce_ex__(4) for the NameAssignment instance in 3.5.0?
I'm not sure yet (it takes some time to set up the right environment to test
this), but I do know which TypeError is getting triggered. In typeobject.c,
it's this stanza in _PyObject_GetState():
assert(slotnames == Py_None || PyList_Check(slotnames));
if (required) {
Py_ssize_t basicsize = PyBaseObject_Type.tp_basicsize;
if (obj->ob_type->tp_dictoffset)
basicsize += sizeof(PyObject *);
if (obj->ob_type->tp_weaklistoffset)
basicsize += sizeof(PyObject *);
if (slotnames != Py_None)
basicsize += sizeof(PyObject *) * Py_SIZE(slotnames);
if (obj->ob_type->tp_basicsize > basicsize) {
Py_DECREF(slotnames);
Py_DECREF(state);
PyErr_Format(PyExc_TypeError,
"can't pickle %.200s objects",
Py_TYPE(obj)->tp_name);
return NULL;
}
}
I don't yet know why the basicsize isn't matching up. |
|
Date |
User |
Action |
Args |
2016-01-07 02:36:21 | barry | set | recipients:
+ barry, pitrou, alexandre.vassalotti, nadeem.vawda, Arfrever, kitterma, python-dev, serhiy.storchaka, josh.r |
2016-01-07 02:36:21 | barry | link | issue22995 messages |
2016-01-07 02:36:18 | barry | create | |
|