On Apr 1, 5:48 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> Peter Bengtsson wrote:
> > Hi, I'm trying to pickle an object instance of a class that is like a
> > dict but with a __getattr__ and I'm getting pickling errors.
> > This is what happens when I'm trying to be clever:
>
> import cPickl
Peter Bengtsson wrote:
> Hi, I'm trying to pickle an object instance of a class that is like a
> dict but with a __getattr__ and I'm getting pickling errors.
> This is what happens when I'm trying to be clever:
>
import cPickle as pickle
class Dict(dict):
> ... def __getattr__(self
Hi, I'm trying to pickle an object instance of a class that is like a
dict but with a __getattr__ and I'm getting pickling errors.
This works but is not good enough.
$ python2.4
>>> import cPickle as pickle
>>> class Dict(dict):
... pass
...
>>>
>>>
>>> friend = Dict(name='Zahid', age=40)
>>>