New submission from Billy <[email protected]>:
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 number of variables, it may be hard to compare each of
them at once, hence this operator can help a lot in such situations.
Of course, using lists appropriately can solve this issue easily, but a
general-direct method for achieving this would be a lot helpful. This also
makes the code more simplistic and easily readable and understandable.
*Sorry for the bad formatting if markdown is not supported for this comment
section, I couldn't find it mentioned anywhere in the python developer's guide.
Hence I'm assuming it is supported since it's a common and highly needed
feature nowadays.
----------
messages: 409091
nosy: billyeatcookies
priority: normal
severity: normal
status: open
title: New `both()` operator for matching multiple variables to one
type: enhancement
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46164>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com