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
Remove reference to undefined dictionary ordering in Tutorial #73639
Comments
Removes Also changes the ordering of the function call to match the previous output. |
LGTM |
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. |
Isn't it a language requirement that PEP-468 states that |
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. |
I would not change the order of keyword arguments, but rather change the output. |
It was a random decision on my part, Serhiy, since I didn't see any difference. Why would you go the other way around? |
Because it shows preserving the order of keyword arguments (rather than sorting by keyword name). |
Indeed, good point. Changed it to the suggested way. |
LGTM. Thanks Jim. But maybe it is worth to mention that the output corresponds to the order of passed keyword arguments. |
You are correct, I didn't read the full context of the diff. My apologies. |
Patch 2 looks fine to me. |
Should I add this note? It looks fine to me as is but I'm not the experienced one here :-) |
I don't know. David, Raymond, what are your thoughts? |
Yes, please. This is a section on keyword arguments, making it the preferred place to mention the new guaranteed output order. |
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. |
Thanks for the revision. Assigning to Mariatta so that she can apply the PR. |
Thanks everyone. PR has been merged and backported to 3.6 :) |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: