pickle function reference ??

Martin v. Löwis martin at v.loewis.de
Wed Nov 12 02:14:04 EST 2003


ted kelly <ted.kelly at comcast.net> writes:

> It seems I can not deepcopy or pickle an object with an attribute that 
> points to any function that is not a built in.

That is not true

import pickle

class A:
    pass

a=A()
a.attr=pickle.loads

data=pickle.dumps(a)
b=pickle.loads(data)
print b.attr

works fine for me.

Regards,
Martin




More information about the Python-list mailing list