[issue46270] Comparison operators in Python Tutorial 5.7

Raymond Hettinger report at bugs.python.org
Wed Jan 5 14:14:42 EST 2022


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

It may seem weird, but a "membership operator" is a kind of "comparison operator".¹  They can even participate in chaining, 'a < b in s < c` is equivalent to `(a < b) and (b in s) and (b < c)`. 

I'm propose this new wording to mention the concept of "membership":

"The comparison operators `in` and `not in` are membership tests that determine whether a value is in (or not in) a container."

¹ https://docs.python.org/3/reference/expressions.html#comparisons

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46270>
_______________________________________


More information about the Python-bugs-list mailing list