msg287048 - (view) |
Author: Jim Fasarakis-Hilliard (Jim Fasarakis-Hilliard) * |
Date: 2017-02-05 15:17 |
Removes `keys = sorted(keywords.keys())` from function example and removes the text that describes why this was necessary. As per PEP 468, this note is obsolete for 3.6+
Also changes the ordering of the function call to match the previous output.
|
msg287050 - (view) |
Author: Inada Naoki (methane) * |
Date: 2017-02-05 15:42 |
LGTM
|
msg287051 - (view) |
Author: R. David Murray (r.david.murray) * |
Date: 2017-02-05 15:44 |
It is not (yet) a language requirement that ordinary dictionaries be ordered. This patch may become appropriate in 3.7, but that has not yet been determined. It is not appropriate for 3.6. In 3.6, the order of keys in an ordinary dictionary is still undefined, even though it is in practice consistent in CPython.
|
msg287053 - (view) |
Author: Jim Fasarakis-Hilliard (Jim Fasarakis-Hilliard) * |
Date: 2017-02-05 15:56 |
Isn't it a language requirement that `**kwargs` be ordered in 3.6, David?
PEP 468 states that `**kwargs` is to be an ordered *mapping* and, if I'm not mistaken, that was done in order to not depend on the fact that dicts became ordered. I might have understood something wrong, though :-)
|
msg287054 - (view) |
Author: Xiang Zhang (xiang.zhang) * |
Date: 2017-02-05 16:01 |
David, actually I have the same thoughts as Jim. Ordered ordinary dicts is not a feature but ordered **kwargs is in 3.6. They seems not the same thing.
|
msg287056 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2017-02-05 16:22 |
I would not change the order of keyword arguments, but rather change the output.
|
msg287057 - (view) |
Author: Jim Fasarakis-Hilliard (Jim Fasarakis-Hilliard) * |
Date: 2017-02-05 16:24 |
It was a random decision on my part, Serhiy, since I didn't see any difference. Why would you go the other way around?
|
msg287058 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2017-02-05 16:33 |
Because it shows preserving the order of keyword arguments (rather than sorting by keyword name).
|
msg287059 - (view) |
Author: Jim Fasarakis-Hilliard (Jim Fasarakis-Hilliard) * |
Date: 2017-02-05 16:41 |
Indeed, good point. Changed it to the suggested way.
|
msg287060 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2017-02-05 16:46 |
LGTM. Thanks Jim.
But maybe it is worth to mention that the output corresponds to the order of passed keyword arguments.
|
msg287061 - (view) |
Author: R. David Murray (r.david.murray) * |
Date: 2017-02-05 19:21 |
You are correct, I didn't read the full context of the diff. My apologies.
|
msg287092 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2017-02-06 07:36 |
Patch 2 looks fine to me.
|
msg287138 - (view) |
Author: Jim Fasarakis-Hilliard (Jim Fasarakis-Hilliard) * |
Date: 2017-02-06 14:27 |
> But maybe it is worth to mention that the output corresponds to the order of passed keyword arguments
Should I add this note? It looks fine to me as is but I'm not the experienced one here :-)
|
msg287219 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2017-02-07 09:33 |
I don't know. David, Raymond, what are your thoughts?
|
msg288047 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2017-02-18 01:11 |
>> But maybe it is worth to mention that the output
>> corresponds to the order of passed keyword arguments
> Should I add this note?
Yes, please. This is a section on keyword arguments, making it the preferred place to mention the new guaranteed output order.
|
msg288081 - (view) |
Author: Jim Fasarakis-Hilliard (Jim Fasarakis-Hilliard) * |
Date: 2017-02-18 14:37 |
Added the following short sentence to the PR, which I believe makes the point clear:
Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call.
|
msg288098 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2017-02-19 03:29 |
Thanks for the revision. Assigning to Mariatta so that she can apply the PR.
|
msg288272 - (view) |
Author: Mariatta (Mariatta) * |
Date: 2017-02-21 06:20 |
New changeset 32e8f9bdfd4324f1aa4fbbdf1ed8536f2b00cabb by Mariatta in branch 'master':
bpo-29453: Remove reference to undefined dictionary ordering in Tutorial (GH-140)
https://github.com/python/cpython/commit/32e8f9bdfd4324f1aa4fbbdf1ed8536f2b00cabb
|
msg288313 - (view) |
Author: Mariatta (Mariatta) * |
Date: 2017-02-21 18:30 |
New changeset 9b49133082ec23b67e84d2589e66d7810018e424 by GitHub in branch '3.6':
bpo-29453: Remove reference to undefined dictionary ordering in Tutorial (GH-140) (#208)
https://github.com/python/cpython/commit/9b49133082ec23b67e84d2589e66d7810018e424
|
msg288314 - (view) |
Author: Mariatta (Mariatta) * |
Date: 2017-02-21 18:32 |
Thanks everyone. PR has been merged and backported to 3.6 :)
Closing this issue.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:58:42 | admin | set | github: 73639 |
2017-02-21 18:32:35 | Mariatta | set | status: open -> closed resolution: fixed messages:
+ msg288314
stage: commit review -> resolved |
2017-02-21 18:30:10 | Mariatta | set | messages:
+ msg288313 |
2017-02-21 06:25:03 | Mariatta | set | pull_requests:
+ pull_request177 |
2017-02-21 06:20:26 | Mariatta | set | messages:
+ msg288272 |
2017-02-19 03:29:38 | rhettinger | set | assignee: serhiy.storchaka -> Mariatta
messages:
+ msg288098 nosy:
+ Mariatta |
2017-02-18 14:37:55 | Jim Fasarakis-Hilliard | set | messages:
+ msg288081 |
2017-02-18 01:12:00 | rhettinger | set | messages:
+ msg288047 |
2017-02-16 20:15:52 | Jim Fasarakis-Hilliard | set | pull_requests:
+ pull_request100 |
2017-02-07 09:33:55 | serhiy.storchaka | set | messages:
+ msg287219 |
2017-02-06 14:27:57 | Jim Fasarakis-Hilliard | set | messages:
+ msg287138 |
2017-02-06 07:36:02 | rhettinger | set | nosy:
+ rhettinger messages:
+ msg287092
|
2017-02-06 02:30:05 | xiang.zhang | set | assignee: docs@python -> serhiy.storchaka |
2017-02-05 19:21:01 | r.david.murray | set | messages:
+ msg287061 versions:
+ Python 3.6 |
2017-02-05 16:46:42 | serhiy.storchaka | set | messages:
+ msg287060 stage: commit review |
2017-02-05 16:41:05 | Jim Fasarakis-Hilliard | set | files:
+ controlflowdiff2.patch
messages:
+ msg287059 |
2017-02-05 16:33:22 | serhiy.storchaka | set | messages:
+ msg287058 |
2017-02-05 16:24:48 | Jim Fasarakis-Hilliard | set | messages:
+ msg287057 |
2017-02-05 16:22:18 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages:
+ msg287056
|
2017-02-05 16:01:55 | xiang.zhang | set | messages:
+ msg287054 |
2017-02-05 15:56:37 | Jim Fasarakis-Hilliard | set | messages:
+ msg287053 |
2017-02-05 15:44:32 | r.david.murray | set | nosy:
+ r.david.murray
messages:
+ msg287051 versions:
- Python 3.6 |
2017-02-05 15:42:37 | methane | set | nosy:
+ methane messages:
+ msg287050
|
2017-02-05 15:28:28 | xiang.zhang | set | nosy:
+ xiang.zhang
|
2017-02-05 15:17:27 | Jim Fasarakis-Hilliard | create | |