This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ammar2
Recipients ammar2, mcara
Date 2017-07-19.05:34:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500442471.68.0.0140043612978.issue30965@psf.upfronthosting.co.za>
In-reply-to
Content
Check out this section of the documentation, notably this part:

"Note that comparisons, membership tests, and identity tests, all have the same precedence and have a left-to-right chaining feature"

Chaining lets you write stuff like this:

>>> x = 1
>>> 0 < x < 2
True

And since membership tests and identity tests are chained, the code you posted above essentially turns into:

(1 in [1]) and ([1] is True)

The former part of that expression is True but the latter is false.
History
Date User Action Args
2017-07-19 05:34:31ammar2setrecipients: + ammar2, mcara
2017-07-19 05:34:31ammar2setmessageid: <1500442471.68.0.0140043612978.issue30965@psf.upfronthosting.co.za>
2017-07-19 05:34:31ammar2linkissue30965 messages
2017-07-19 05:34:31ammar2create