[New-bugs-announce] [issue20855] RFE: change bool(0.0) to evaluate as True

Alexander Belopolsky report at bugs.python.org
Wed Mar 5 23:50:10 CET 2014


New submission from Alexander Belopolsky:

The rationale for making this change is that the current behaviour converts a stylistic problem in checking values against a sentinel via "bool(value)" instead of "value is not None" into a subtle data driven behavioural bug that only occurs exactly at 0x0.0p+0.

If someone wants to write the patch to deprecate this behaviour in Python 3.5 (reporting a deprecation warning whenever midnight is interpreted as False, perhaps suggesting the use of "is" or "is not" instead), and then actually change the behaviour in 3.6, I don't believe we should actively oppose them from doing so.

See also issue #13936.

----------
components: Interpreter Core
keywords: easy
messages: 212772
nosy: belopolsky, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: RFE: change bool(0.0) to evaluate as True
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20855>
_______________________________________


More information about the New-bugs-announce mailing list