Sorry, I'm not very familiar with Cython, but it looks to me that Cython creates extension classes that can't be correctly copied and unpickled. Since default __reduce_ex__ implementation knows nothing about Cython class structure, it's result doesn't contain the state of the object. The object could be pickled, but unpickled object doesn't contain original values of fields, it is just non-initialized. In recent CPython releases was added new restrictions for pickling objects that can't be correctly unpickled. This had added incompatibility with Cython classes. Building some packages now is failed, because Cython makes a deep copy that actually doesn't work.

See for original changes and discussion about the regression: http://bugs.python.org/issue22995 .

Besides the fact of Cython regression, it looks to me, that Cython also needs to be fixed. It can be done either by generating default pickle-related methods (__getnewargs__/__getnewargs_ex__, or __getstate__ + __setstate__, or __reduce__/__reduce_ex__) for all Cython classes, or implementing pickling or deepcopying only for NameAssignment and like.

_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to