Message159539
| Author |
godfryd |
| Recipients |
docs@python, ezio.melotti, godfryd, ncoghlan |
| Date |
2012年04月28日.20:38:45 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1335645526.65.0.0444021981683.issue14570@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In json module there are dump/dumps methods which internally instantiate encoder class JSONEncoder (or some other user-defined encoder clas).
They look as follows:
json.dump(obj, fp,
skipkeys=False,
ensure_ascii=True,
check_circular=True,
allow_nan=True,
cls=None,
indent=None,
separators=None,
default=None,
**kw)
json.JSONEncoder(skipkeys=False,
ensure_ascii=True,
check_circular=True,
allow_nan=True,
sort_keys=False,
indent=None,
separators=None,
default=None)
Some of dump/dumps arguments are passed to encoder class:
- skipkeys
- ensure_ascii
- check_circular
- allow_nan
- indent
- separators
- default
And it looks that sort_keys is just missing in keyword args in dump/dumps method.
But it still can be passed implicitly using **kw arg.
I would propose to do:
- add explicitly sort_keys keyword arg to dump/dumps methods
- add passing it to encoder class
- and adjust documentation accordingly. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月28日 20:38:46 | godfryd | set | recipients:
+ godfryd, ncoghlan, ezio.melotti, docs@python |
| 2012年04月28日 20:38:46 | godfryd | set | messageid: <1335645526.65.0.0444021981683.issue14570@psf.upfronthosting.co.za> |
| 2012年04月28日 20:38:46 | godfryd | link | issue14570 messages |
| 2012年04月28日 20:38:45 | godfryd | create |
|