You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, highlighting tells us that the assertion error has occurred in expression 10 < 20.
However, according to short-circuit evaluation, the expression that has really activated assertion error is the first one: 0 <= -1.
Possible fixes
Highlight only the evaluated part
Evaluate expressions separated by and from left to right. When an expression gets evaluated to False, highlight only that expression. (I think this is more intuitive since this follows short-circuit evaluation rule.)
Highlight the whole expression
When any part of assert statement gets evaluated to False, highlight whole expression. This fix may be little unfriendly than previous fix, but better than current incorrect behavior.
CPython versions tested on:
3.11
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered:
Bug report
Bug description:
Environment
How to reproduce
main.py
with the following contents:main.py
. An AssertionError occurs:Problem
Currently, highlighting tells us that the assertion error has occurred in expression
10 < 20
.However, according to short-circuit evaluation, the expression that has really activated assertion error is the first one:
0 <= -1
.Possible fixes
Highlight only the evaluated part
Evaluate expressions separated by
and
from left to right. When an expression gets evaluated to False, highlight only that expression. (I think this is more intuitive since this follows short-circuit evaluation rule.)Highlight the whole expression
When any part of assert statement gets evaluated to False, highlight whole expression. This fix may be little unfriendly than previous fix, but better than current incorrect behavior.
CPython versions tested on:
3.11
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: