[issue32055] Reconsider comparison chaining for containment tests

Guido van Rossum report at bugs.python.org
Tue Sep 11 18:09:48 EDT 2018


Guido van Rossum <guido at python.org> added the comment:

I agree that it would be less confusing if `in`/`not in` did not allow chaining, the occasional (surely very rare) useful example notwithstanding.

Then again if we're going to forbid (or even discourage) unusual combinations we might also want to frown at `a < b > c` -- surely in mathematical circles the chaining always goes in one direction only, e.g. `a < b <= c` or `a >= b ==c > d`.

Finally as long as we're refining the terminology, maybe we could strive to distinguish "comparison" (`==` and `!=`) from "ordering" (`<`, `<=`, `>`, `>=`)?

----------
nosy: +gvanrossum

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


More information about the Python-bugs-list mailing list