Mark Mikofski added the comment:

This is effecting IronPython as well, because .NET objects return copies not 
references. If a .NET assembly method is called from IronPython, its return is 
a copy, not a reference. Therefore the reference of a boolean return is not the 
same as the internal Python reference for that boolean, and the JSON encoder 
doesn't recognize the value as a boolean, but instead  treats it as an integer, 
and returns `str(o)`, which for `True` is "True" and for `False` is "False". 
Then the decoder can't interpret the JSON object because true and false are 
capitalize, which is not in its spec. :(

See my comment https://github.com/IronLanguages/main/issues/1033.

The patch would solve this problem. A copy of a boolean will be equal to  its 
value, ie False == False even if their references are not the same.

----------
nosy: +bwanamarko

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4945>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to