[Cython] Resurrecting __dict__ for extension types

Ian Bell ian.h.bell at gmail.com
Wed Jun 6 10:04:07 CEST 2012


As per a couple of discussions online (
http://mail.python.org/pipermail/cython-devel/2011-February/000122.html),
it looks like at one point it was pretty close to being able to
programmatically and automatically generate a __dict__ for extension types
like for CPython classes.  I have to manually code a function that does
exactly what __dict__ should do, and it is a pain.  I have some classes
with tens of attributes, and that is already a big enough pain.  This is
especially useful to more easily enable deepcopy and pickling for classes.

While on the pickling theme, it seems it really ought to be pretty
straightforward to automatically pickle extension types.  Don't you already
have all the necessary information at compile time?  This was on the wish
list at one point if I am not mistaken and would be very useful to me and
lots of other people.

I'm finally loving coding in Cython and am finally making sense of how best
to use extension types.

Regards,
Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20120606/596190e2/attachment.html>


More information about the cython-devel mailing list