Hi, the short version of my question is: when is a dictionary's
__contains__ method behavior different to using the 'in' idiom?
(because I have an example of a difference in my code).
Longer version: I have a user-defined class with a few overrides of
special methods, particularly __eq__ and
Rob Clewley wrote:
Hi, the short version of my question is: when is a dictionary's
__contains__ method behavior different to using the 'in' idiom?
(because I have an example of a difference in my code).
Never.
Longer version: I have a user-defined class with a few overrides of
special
On Mon, 12 Jan 2009 22:41:00 -0500, Rob Clewley wrote:
Hi, the short version of my question is: when is a dictionary's
__contains__ method behavior different to using the 'in' idiom? (because
I have an example of a difference in my code).
[...]
i in d.keys() and d.keys()[10] == i
both
Hi, the short version of my question is: when is a dictionary's
__contains__ method behavior different to using the 'in' idiom?
(because I have an example of a difference in my code).
Never.
Yes, sorry, I managed to summarize the long version incorrectly :)
Well, the only conclusion is