Message404553
I think Dennis's example is fatal: from section 6.10 ("Comparisons"):
"""
Comparisons can be chained arbitrarily, e.g., `x < y <= z` is equivalent to `x < y and y <= z`, except that y is evaluated only once (but in both cases z is not evaluated at all when x < y is found to be false).
"""
So doing LOAD_FAST twice on x (in `1 < x < 3`) is prohibited by the language definition. Doesn't matter to this whether it's plain `x` or `f(x)` where `f()` is some arbitrary function: the object the middle comparand signifies is fixed at whatever it was when the the first comparison is evaluated. |
|
Date |
User |
Action |
Args |
2021-10-21 00:17:40 | tim.peters | set | recipients:
+ tim.peters, Dennis Sweeney, akuvfx |
2021-10-21 00:17:40 | tim.peters | set | messageid: <1634775460.84.0.834236778697.issue45542@roundup.psfhosted.org> |
2021-10-21 00:17:40 | tim.peters | link | issue45542 messages |
2021-10-21 00:17:40 | tim.peters | create | |
|