[Python-Dev] A little GC confusion

Jeremy Hylton jeremy@alum.mit.edu
2002年2月22日 22:59:58 -0500


[I wrote:]
> One property of types that do not have define HEAPTYPE is that their
> __module__ attribute is always __builtin__. This makes them
> mighty hard to
> pickle. It further suggests that every type that isn't a builtin type
> should define HEAPTYPE.

I don't think I made much sense above. I meant to say: When my C types
didn't define HEAPTYPE, it was impossible to pickle them. When I added the
HEAPTYPE and defined __safe_for_unpickling__ as a data member, it became
possible to pickle instances of those types. It was far from obvious,
though, that I needed to do those two things to make pickling work.
Jeremy

AltStyle によって変換されたページ (->オリジナル) /