Message60629
I've got a class:
class odict(dict):
def __init__(self, d={}):
self._keys = d.keys()
dict.__init__(self, d)
def __setitem__(self, key, item):
dict.__setitem__(self, key, item)
if key not in self._keys:
self._keys.append(key)
...
When I copy.deepcopy one of these it blows up in
__setitem__ with an AttributeError on _keys, because
__setitem__ is called without __init__ ever having been
called. Presumably this thing looks and smells like a
dictionary, so deepcopy thinks it is one.
|
|
Date |
User |
Action |
Args |
2008-01-20 09:57:24 | admin | link | issue1099746 messages |
2008-01-20 09:57:24 | admin | create | |
|