From: SourceForge.net <no...@so...> - 2007-12-02 20:13:33
|
Bugs item #1839871, was opened at 2007-11-27 18:20 Message generated for change (Comment added) made by cgroves You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1839871&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: tristan (tristanlk) Assigned to: Nobody/Anonymous (nobody) Summary: dict shouldn't call __setitem__ to initialise Initial Comment: 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' ---------------------------------------------------------------------- >Comment By: Charles Groves (cgroves) Date: 2007-12-02 15:13 Message: Logged In: YES user_id=1174327 Originator: NO Fixed in r3754. Thanks! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1839871&group_id=12867 |