durusmail: durus-users: subclassing PeristentDict
subclassing PeristentDict
2006-02-06
2006-02-06
2006-02-06
subclassing PeristentDict
Jeff Bauer
2006-02-06
Running code to store a derived PersistentDict:

     class Staff(PersistentDict):
         pass

Produces the following error:

   AttributeError: 'Staff' object has no attribute 'data'

I'm familiar enough with old-style UserDict/UserList to
know that I've got to add the following:

     class Staff(PersistentDict):
         def __init__(self):
             PersistentDict.__init__(self)

However, I'm wondering if the error makes sense to
someone just getting started.  Comments?  FAQ fodder?

--
Jeff Bauer      http://serpentaddiction.blogspot.com
Rubicon, Inc.   http://www.rubic.com
reply