[issue46164] New `both()` operator for matching multiple variables to one

2021-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Just use if a == b == 1: Comparisons can be chained arbitrarily. https://docs.python.org/3/reference/expressions.html#comparisons -- nosy: +steven.daprano resolution: -> rejected stage: -> resolved status: open -> closed

[issue46164] New `both()` operator for matching multiple variables to one

2021-12-23 Thread Eric V. Smith
Eric V. Smith added the comment: I think this is a rarely needed operation. I looked through a few tens of thousand lines of my code and couldn't find anywhere it would be used. Plus, you could write it yourself, so I don't see the advantage of it being part of the language or standard

[issue46164] New `both()` operator for matching multiple variables to one

2021-12-23 Thread Billy
New submission from Billy : A new `both()` operator for matching multiple variables to one at the same time. Currently, ```py if a == 1 and b == 1: ... ``` With a `both()` operator, it can be done as follows (concept): ```py if both(a, b) == 1: ... ``` Why? -> With the increasing