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.
Created on 2010年08月20日 15:43 by mdirolf, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| sort_keys_json.patch | mdirolf, 2010年08月20日 15:43 | |||
| Messages (3) | |||
|---|---|---|---|
| msg114426 - (view) | Author: Mike Dirolf (mdirolf) | Date: 2010年08月20日 15:43 | |
The json module docs state that sort_keys defaults to True. From the source it looks like it actually defaults to False. Patch attached. |
|||
| msg114445 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2010年08月20日 19:56 | |
In 3.1, and I presume (please check) 2.7, the signature is given as class json.JSONEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None) I verified by simple experiment that keys are not sorted by default. So the later claim "If sort_keys is True (the default)" is wrong and should be corrected. The patch or something much like it should be applied. Thanks for catching this error. |
|||
| msg114700 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2010年08月22日 20:23 | |
Thanks, fixed in r84264. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:05 | admin | set | github: 53858 |
| 2010年08月22日 20:23:58 | georg.brandl | set | status: open -> closed nosy: + georg.brandl messages: + msg114700 resolution: fixed |
| 2010年08月20日 19:56:17 | terry.reedy | set | versions:
+ Python 3.1, Python 3.2 nosy: + terry.reedy messages: + msg114445 type: behavior stage: commit review |
| 2010年08月20日 15:43:14 | mdirolf | create | |