Message2020
when a non-dict is passed as input to a dict __setitem__ is called to set the values. this is fine for dict objects, but can break things inheriting from dict (i.e. see attachment). __setitem__ shouldn't be called until __init__ is complete.
i'm working out of the trunk.
here's the outputs i get from the attached test case:
$ python dict_inheritance_bug.py
{'a': 1}
$ jython dict_inheritance_bug.py
Traceback (innermost last):
File "dict_inheritance_bug.py", line 9, in ?
File "dict_inheritance_bug.py", line 3, in __init__
File "dict_inheritance_bug.py", line 7, in __setitem__
AttributeError: '__main__.Test' object has no attribute 'doStuff' |
|
Date |
User |
Action |
Args |
2008-02-20 17:18:07 | admin | link | issue1839871 messages |
2008-02-20 17:18:07 | admin | create | |
|