Bool variable with json.dumps

Hongyi Zhao hongyi.zhao at gmail.com
Sun Sep 15 07:48:02 EDT 2019


On Sun, 15 Sep 2019 19:36:20 +1000, Cameron Simpson wrote:

> Because that's how the true value is spelt in JavaScript. You _are_
> aware that JSON is "JavaScript Object Notation", are you not? So
> json.dumps translates Python values into JavaScript syntax.
> 
> This is likely to be the same reason you were wondering about None vs
> null; broadly, the Python None value serves the same purpose as the
> JavaScript null value, and therefore that is how it is expressed in
> JSON.

Thanks a lot for your notes.



More information about the Python-list mailing list