By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,485 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,485 IT Pros & Developers. It's quick & easy.

pickle function reference ??

P: n/a
It seems I can not deepcopy or pickle an object with an attribute that
points to any function that is not a built in.
I thought it should be ok as long as the function is defined in the top
level of a module.
What am I missing??
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ted kelly <te*******@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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.