On Wed, Mar 1, 2017 at 1:56 PM, 语言破碎处 <[email protected]> wrote:
> I'm bited once:
> >>> '' in {} == False
> False
> >>> ('' in {}) == False
> True
>
> # '' in {} == False ==>> ('' in {}) and ({} == False) ==>> False!
>
> I think only compare operations should be chained.
I do feel your pain, but generally, you shouldn't be using "== False"
to negate a condition. That's what the "not" operator is for - or
inverted conditions.
>>> '' not in {}
True
Much better. :)
ChrisA
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/