[issue42394] Exception handling on boolean comparisons

2020-11-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: 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:

[issue42394] Exception handling on boolean comparisons

2020-11-17 Thread Christopher Contaxis
New submission from Christopher Contaxis : Python 3.8.6 will not produce an exception when comparing values in an and/or statement that normally produces an exception standalone. val = 0 low = 1 high = "2" The following makes sense: val >= low : False val <= high : Exception, cant compare in