Message351347
I'm sorry you're not satisfied with the answer, but I'm a bona fide expert on this and you're not going to get anyone to agree with your confusion here ;-)
But the bug tracker is not the right place for tutorials. Please take this up on, e.g., the Python mailing list instead. There is no bug here.
One hint: in
EXPR1 or EXPR2
bool(EXPR1) is _always_ evaluated first. It makes no difference at all to this whether EXPR1 is "x < y" or "1 + 2 + 3" or "9". Trying to make a special case out of "a numerical value" is entirely in your own head: the language does nothing of the sort.
9 or (ANYTHING_AT_ALL)
always results in 9, for the same reason
4+5 or (ANYTHING_AT_ALL)
always results in 9. Whether the left-hand expression evaluating to 9 is a literal or a complex expression is irrelevant.
In the same way, e.g.,
x = 9
and
x = 4+6
both bind x to 9. A numeric literal is just as much "an expression" as any other kind of expression. "Single value" has nothing to do with this. |
|
Date |
User |
Action |
Args |
2019-09-09 04:47:48 | tim.peters | set | recipients:
+ tim.peters, sangeetamchauhan |
2019-09-09 04:47:48 | tim.peters | set | messageid: <1568004468.71.0.362903428178.issue38060@roundup.psfhosted.org> |
2019-09-09 04:47:48 | tim.peters | link | issue38060 messages |
2019-09-09 04:47:48 | tim.peters | create | |
|