Message351758
I think that the problem is that the precedence table may be technically
correct, but it doesn't describe the actual behaviour of expressions
including the boolean operators ``or`` and ``and`` for exactly the
reason Tim gives:
> Precedence rules alone are too feeble to capture that.
If I didn't know that boolean operators short-circuited, I too would
have expected that an expression like ``9 or 7 < "str"`` would have
raised an exception.
The documentation (precedence table) isn't wrong, it's just incomplete.
The information needed exists, but it is elsewhere, and if you don't
already know it, you don't know that you need to look for it.
I think that the precedence table could do with a footnote on the two
boolean operators describing their interaction with short-circuiting
behaviour and linking back to the relevant section 6.11.
https://docs.python.org/3/reference/expressions.html#boolean-operations |
|
Date |
User |
Action |
Args |
2019-09-10 23:54:36 | steven.daprano | set | recipients:
+ steven.daprano, tim.peters, sangeetamchauhan |
2019-09-10 23:54:36 | steven.daprano | link | issue38060 messages |
2019-09-10 23:54:36 | steven.daprano | create | |
|