Ezio Melotti added the comment: https://docs.python.org/3/reference/expressions.html#comparisons says that "a op1 b op2 c ... y opN z is equivalent to a op1 b and b op2 c and ... y opN z" and this explains the "unexpected" result:
>>> 1 in [1] == True False >>> 1 in [1] and [1] == True False "in" and "not in" are also listed among the comparison operators, so I think this behavior is expected and by design. I don't think there's anything that needs to be fixed here. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25484> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com