Message2848
Your patch does indeed fix the original issue, but checking for an instance of PyDictionary in PyObject isn't the right solution here. PyObject doesn't need to know anything about its PyDictionary subclass when we can utilize polymorphism to make PyDictionary do the right thing
PyObject subclasses are made to be able to override PyObject methods when they want to implement their own custom versions (such as for performance reasons, like this issue) of Python methods
So PyDictionary needs to override __contains__ to call its own dict___contains__. PyObject's in/notin can stay the same; simply call __contains__
The following patch does this instead (I can't attach it here):
http://underboss.org/~pjenvey/patches/dict_contains_r3455.diff
It also changes dict___contains__ to call has_key instead of the final dict_has_key method -- so if a subclass overrides has_key, __contains__ will utilize the overridden version |
|
Date |
User |
Action |
Args |
2008-02-20 17:18:48 | admin | link | issue1783803 messages |
2008-02-20 17:18:48 | admin | create | |
|