Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

json.dumps doesn't work properly for Nullable[bool] #1299

Closed
slozier opened this issue Jun 9, 2016 · 2 comments · Fixed by #1332
Closed

json.dumps doesn't work properly for Nullable[bool] #1299

slozier opened this issue Jun 9, 2016 · 2 comments · Fixed by #1332

Comments

@slozier
Copy link
Contributor

slozier commented Jun 9, 2016

json.dumps is returning True instead of true for a Nullable[bool] (similarly False instead of false).

Sample code:

import json
from System import Nullable
assert json.dumps(Nullable[bool](True)) == "true"
@slide slide removed the untriaged label Aug 1, 2016
@kunom
Copy link
Contributor

kunom commented Aug 17, 2016

This boils down to

IronPython 2.7.5 (2.7.5.0) on .NET 4.0.30319.42000 (32-bit)
>>> from System import Nullable, Boolean
>>> Nullable[Boolean](True) is True
False

@slide
Copy link
Contributor

slide commented Aug 17, 2016

Correct, it's doing a reference comparison...this issue exists in other places too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants