Message381291
This is not a bug, it is normal handling of `and` and `or` operators since Python 1.5 and possibly older.
The `and` and `or` operators are *short-cut* operators. This is intentional design, so we can write things like:
if mylist and mylist[0] == value:
the `mylist[0] == value` expression is only evaluated if `mylist` is a truthy value.
This is all documented here:
https://docs.python.org/3/reference/expressions.html#boolean-operations |
|
Date |
User |
Action |
Args |
2020-11-17 21:53:25 | steven.daprano | set | recipients:
+ steven.daprano, CanisUrsa |
2020-11-17 21:53:25 | steven.daprano | set | messageid: <1605650005.67.0.201322723388.issue42394@roundup.psfhosted.org> |
2020-11-17 21:53:25 | steven.daprano | link | issue42394 messages |
2020-11-17 21:53:25 | steven.daprano | create | |
|