Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor typo #67668

Closed
zorigt mannequin opened this issue Feb 18, 2015 · 3 comments
Closed

Minor typo #67668

zorigt mannequin opened this issue Feb 18, 2015 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@zorigt
Copy link
Mannequin

zorigt mannequin commented Feb 18, 2015

BPO 23480
Nosy @vadmium

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2015-02-18.22:38:55.761>
created_at = <Date 2015-02-18.22:23:57.192>
labels = ['invalid', 'docs']
title = 'Minor typo'
updated_at = <Date 2015-02-18.22:41:20.232>
user = 'https://bugs.python.org/zorigt'

bugs.python.org fields:

activity = <Date 2015-02-18.22:41:20.232>
actor = 'martin.panter'
assignee = 'docs@python'
closed = True
closed_date = <Date 2015-02-18.22:38:55.761>
closer = 'SilentGhost'
components = ['Documentation']
creation = <Date 2015-02-18.22:23:57.192>
creator = 'zorigt'
dependencies = []
files = []
hgrepos = []
issue_num = 23480
keywords = []
message_count = 3.0
messages = ['236195', '236198', '236199']
nosy_count = 4.0
nosy_names = ['SilentGhost', 'docs@python', 'martin.panter', 'zorigt']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue23480'
versions = []

@zorigt
Copy link
Mannequin Author

zorigt mannequin commented Feb 18, 2015

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}'

@SilentGhost
Copy link
Mannequin

SilentGhost mannequin commented Feb 18, 2015

If you run the command in your interpreter you'll see that the output is correct.

@SilentGhost SilentGhost mannequin added the docs Documentation in the Doc dir label Feb 18, 2015
@SilentGhost SilentGhost mannequin closed this as completed Feb 18, 2015
@SilentGhost SilentGhost mannequin added the invalid label Feb 18, 2015
@SilentGhost SilentGhost mannequin assigned docspython Feb 18, 2015
@vadmium
Copy link
Member

vadmium commented Feb 18, 2015

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant