Mihai Cara added the comment:
I am sure that some time ago I read that `in` is a comparison operator but I
forgot it and I was thinking that (x in y) would be equivalent to (replaced
with) the return value of y.__contains__(x).
--
___
Python
Mihai Cara added the comment:
Thank you! It was my fault: I was not expecting `in` to be a comparison
operator.
--
___
Python tracker
<http://bugs.python.org/issue30
New submission from Mihai Cara:
Unexpected behavior of operator "in" when checking if a list/tuple/etc.
contains a value:
>>> 1 in [1] is True
False
>>> (1 in [1]) is True
True
Is this a bug? If not, please explain why first variant return False.
--