[New-bugs-announce] [issue42394] Exception handling on boolean comparisons
Christopher Contaxis
report at bugs.python.org
Tue Nov 17 16:37:45 EST 2020
New submission from Christopher Contaxis <CanisUrsa818 at gmail.com>:
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 int and str
val <= high and val >= low : Exception, cant compare int and str
The following doesn't make sense (doesn't produce an exception):
val >= low and val <= high : False
----------
messages: 381289
nosy: CanisUrsa
priority: normal
severity: normal
status: open
title: Exception handling on boolean comparisons
type: behavior
versions: Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42394>
_______________________________________
More information about the New-bugs-announce
mailing list