On Fri, Mar 6, 2015 at 10:11 AM,  <sohcahto...@gmail.com> wrote:
> I would argue that if `a is b` then it is obvious that `a == b`

This is not true for float("nan"), though. The question is, is your
above statement a valid optimization for the 'in' operator, or not?
And no, it isn't, because it's not perfectly safe. However, there are
other invariants that mean that 'in' has to allow object identity to
count; for instance:

for elem in collection:
    assert elem in collection

should never assert-fail.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to