Steven Bethard <[EMAIL PROTECTED]> writes: > John J. Lee wrote: > > Steven Bethard <[EMAIL PROTECTED]> writes: > >>In Python 2.4: > >> > >>py> class A(object): > >>... def foo(self): > >>... print 'foo' > >>... bar = foo > >>... > >>py> import pickle > >>py> pickle.loads(pickle.dumps(A)).bar > >><unbound method A.foo> > >>py> pickle.loads(pickle.dumps(A())).bar() > >>foo > > I meant class instances. > > Look closer. The second example pickles and unpickles an instance of > class A.
Oh, I guess it was functions as *instance* attributes that mess up pickle. John -- http://mail.python.org/mailman/listinfo/python-list