>> 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 that dict uses the hash of an object to test > containment while lists use id. Great, thanks. I think a copy of my object has been made so that it doesn't hash to the same thing. I'll write a __hash__ as suggested in the other post. I forgot all about dictionary hashing for some reason... -Rob -- http://mail.python.org/mailman/listinfo/python-list