[issue30550] Document order-preserving dictionary output in json

2019-08-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue30550] Document order-preserving dictionary output in json

2019-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 4a40498ea96a3c606952712c7951b2ea4ab258e4 by Raymond Hettinger (Miss Islington (bot)) in branch '3.8': bpo-30550: Clarify JSON ordering guarantees (GH-15397) (GH-15403)

[issue30550] Document order-preserving dictionary output in json

2019-08-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +15110 pull_request: https://github.com/python/cpython/pull/15403 ___ Python tracker ___

[issue30550] Document order-preserving dictionary output in json

2019-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 657008ea0336ff4f275ed3f0c2b6dd2e52de2bba by Raymond Hettinger in branch 'master': bpo-30550: Clarify JSON ordering guarantees (GH-15397) https://github.com/python/cpython/commit/657008ea0336ff4f275ed3f0c2b6dd2e52de2bba --

[issue30550] Document order-preserving dictionary output in json

2019-08-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +15105 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15397 ___ Python tracker

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Kyle Stanley
Kyle Stanley added the comment: > Please keep focused on the OP's thought that the JSON docs should explicitly > promised that > key/value pairs are added in the order that they are encountered. The > existing JSON docs imply > this pretty strongly, but it can be made more explicit. I agree

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- priority: normal -> low versions: -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Kyle, the link you gave already discusses performance to the extent that it matters. Please keep focused on the OP's thought that the JSON docs should explicitly promised that key/value pairs are added in the order that they are encountered. The

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Kyle Stanley
Kyle Stanley added the comment: > OrderedDict is not recommended to preserve order any more. > Please forget about OrderedDict unless you need additional feature > OrderedDict provides. It is far inefficient than regular dict. Thanks for the clarification. Should this recommendation be

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: The essence of the original post is simply to document any order-preserving properties of the Python to JSON and JSON to Python transformation for mappings. This way users can rely on it. This is for instance useful if a program modifies JSON created by a

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Inada Naoki
Inada Naoki added the comment: OrderedDict is not recommended to preserve order any more. Note that mention about `object_pairs_hook=OrderedDict` is removed intentionally. https://github.com/python/cpython/pull/5001 Please forget about OrderedDict unless you need additional feature

[issue30550] Document order-preserving dictionary output in json

2019-07-21 Thread Kyle Stanley
Kyle Stanley added the comment: >Thus, if a user gives an OrderedDict (or a dict with a known order, in Python >3.7+), it is useful that >he know that the order of its elements will not be >changed upon transformation into JSON. I would agree that it could be helpful to document that if a

[issue30550] Document order-preserving dictionary output in json

2019-07-14 Thread Eric O. LEBIGOT
Eric O. LEBIGOT added the comment: Kyle, what you're saying is correct but is unfortunately unrelated to any of the points in the original issue. In fact, the JSON encoder does preserve whatever order the dictionary elements are in, and it would be useful to document this. Thus, if a user

[issue30550] Document order-preserving dictionary output in json

2019-07-13 Thread Kyle Stanley
Kyle Stanley added the comment: > The JSON encoder for dictionaries preserves the order of the items in a > dictionary >From what I can tell, the JSON encoder does nothing to preserve the order of >the keys. Although the default option is to not modify the existing >dictionary, the items()

[issue30550] Document order-preserving dictionary output in json

2019-07-11 Thread Josh Rosenberg
Josh Rosenberg added the comment: Is there a reason to document object_pairs_hook=OrderedDict rather than just making the decoder populate a regular dict in an order-preserving way? (No idea if it does this already) -- nosy: +josh.r ___ Python

[issue30550] Document order-preserving dictionary output in json

2019-07-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker ___

[issue30550] Document order-preserving dictionary output in json

2019-07-11 Thread Dima Tisnek
Change by Dima Tisnek : -- nosy: +Dima.Tisnek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30550] Document order-preserving dictionary output in json

2017-06-02 Thread Eric O. LEBIGOT
Changes by Eric O. LEBIGOT : -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python ___ Python tracker

[issue30550] Document order-preserving dictionary output in json

2017-06-02 Thread Eric O. LEBIGOT
Changes by Eric O. LEBIGOT : -- title: Document order-preserving dictionary output in son -> Document order-preserving dictionary output in json ___ Python tracker