why can't I pickle a class containing this dispatch dictionary?

jkn jkn_gg at nicorp.f9.co.uk
Tue Apr 3 08:57:52 EDT 2012


Hi Peter

On Apr 3, 8:54 am, Peter Otten <__pete... at web.de> wrote:
> jkn wrote:
> >     I'm clearly not understanding the 'can't pickle instancemethod
> > objects' error; can someone help me to understand,
>
> I think classes implemented in C need some extra work to make them
> picklable, and that hasn't been done for instance methods.

by 'classes implemented in C', doyou mean new-style classes', or what,
please?


>
> > & maybe suggest a
> > workaround, (apart from the obvious if ... elif...).
>
> You can implement pickling yourself:
>
> [...]

Hmm - interesting, thanks. I'm more trying to understand the issue at
the moment, but it's always nice to learn...

    Thanks
    J^n



More information about the Python-list mailing list