TL;DR Is it possible to use C code to implement the (un)pickling of an type
written in a C extension, as it was written in _pickle.c?

Long explaining: I'm trying to create a C extension for frozendict. For
simplicity, first I wrote it in CPython, then I started to move it in a C
extension. It seems to work, but I have to move the code I wrote in
_pickle.c and pickle.py in the C extension. Is it possible, or I have to
create a slower `__reduce_ex__` method that simply converts it to dict?

This is, for example, the C code for pickling frozendict in _pickle.c:
https://github.com/Marco-Sulla/cpython/blob/41a640a947c36007e56bbc28f362c261110d2001/Modules/_pickle.c#L3370
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/KJAC7STSXVD7SBK66HBMXIFPPX7SS5TO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to