This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Minor typo
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: SilentGhost, docs@python, martin.panter, zorigt
Priority: normal Keywords:

Created on 2015-02-18 22:23 by zorigt, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg236195 - (view) Author: Zorigt Bazarragchaa (zorigt) Date: 2015-02-18 22:23
I found a syntax type in your demo example on https://docs.python.org/2/library/json.html

>>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)
{"a": 0, "b": 0, "c": 0}

The correct return should be a 'str' type not json. Therefore:

>>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)
'{"a": 0, "b": 0, "c": 0}'
msg236198 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-02-18 22:38
If you run the command in your interpreter you'll see that the output is correct.
msg236199 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-02-18 22:41
It returns a string, and the print statement/function prints the contents of that string. Perhaps you are confused between JSON strings, which appear in the output, and Python strings, which hold the characters to output.
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67668
2015-02-18 22:41:20martin.pantersetnosy: + martin.panter
messages: + msg236199
2015-02-18 22:38:55SilentGhostsetstatus: open -> closed

assignee: docs@python
components: + Documentation, - Demos and Tools

nosy: + docs@python, SilentGhost
messages: + msg236198
resolution: not a bug
2015-02-18 22:23:57zorigtcreate