Message409091
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. |
|
Date |
User |
Action |
Args |
2021-12-23 14:22:03 | billyeatcookies | set | recipients:
+ billyeatcookies |
2021-12-23 14:22:03 | billyeatcookies | set | messageid: <1640269323.26.0.968410653987.issue46164@roundup.psfhosted.org> |
2021-12-23 14:22:03 | billyeatcookies | link | issue46164 messages |
2021-12-23 14:22:03 | billyeatcookies | create | |
|