[New-bugs-announce] [issue4945] json checks True/False by identity, not boolean value

Gabriel Genellina report at bugs.python.org
Wed Jan 14 06:31:38 CET 2009


New submission from Gabriel Genellina <gagsl-py2 at yahoo.com.ar>:

json compares arguments against True/False by identity, not by boolean 
value; by example:

    if (skipkeys is False and ensure_ascii is True and
        check_circular is True and allow_nan is True ...

Using `ensure_ascii=1` won't work as intended. I don't see the reason 
to check those values by identity - they *are* boolean flags, and 
should be checked by value, as the usual practice.

The attached patch fixes the code and documentation (and a bug encoding 
True/False as keys, including unit tests)

----------
components: Library (Lib)
messages: 79832
nosy: gagenellina
severity: normal
status: open
title: json checks True/False by identity, not boolean value
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

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


More information about the New-bugs-announce mailing list