What did you do?
>>> import ujson
>>> ujson.dumps({True: 1, False: 2, None: 3})
'{"True":1,"False":2,"null":3}'
What did you expect to happen?
I expected bool values to be serialized as lower-case strings "true" and "false" as standard in JSON. This is what happens with the standard json library:
>>> import json
>>> json.dumps({True: 1, False: 2, None: 3})
'{"true": 1, "false": 2, "null": 3}'
Note that None did produce the expected lower-case "null" value.
What actually happened?
The strings were capitalized, which suggests that they were produced by Python's str or repr.
What versions are you using?
- OS: Debian 11
- Python: 3.9.16
- UltraJSON: 5.8.0
What did you do?
What did you expect to happen?
I expected bool values to be serialized as lower-case strings "true" and "false" as standard in JSON. This is what happens with the standard json library:
Note that
Nonedid produce the expected lower-case "null" value.What actually happened?
The strings were capitalized, which suggests that they were produced by Python's
strorrepr.What versions are you using?