bpo-32337: Update tutorial and documentation related with dict order.#4973
bpo-32337: Update tutorial and documentation related with dict order.#4973methane merged 11 commits into
Conversation
e9c06d0 to
3936c37
Compare
December 22, 2017 11:16
|
I'm voting AGAINST this. order in |
Sorry, something went wrong.
|
@socketpair order is guaranteed in 3.7. And @rhettinger is proposing to deprecate |
Sorry, something went wrong.
a69a5e7 to
73b6e50
Compare
December 24, 2017 14:53
|
Done. Thanks methane for your explanation. |
Sorry, something went wrong.
|
Oh sorry, I did't saw it. That solution is great, and I am going to remove the tests in this PR. And I am wondering is there necessary to keep the "test_copy_ordering" and 'test_comprehension_ordering' here? Since there have no tests for them. |
Sorry, something went wrong.
|
I'm OK for document body, but I think someone can write more good commit message and NEWS entry. (Sorry, I'm not good English writer) This PR updates only tutorial. But I think other commits will be made before 3.7 final can |
Sorry, something went wrong.
|
Since we are editing this part, I have a question why do we use |
Sorry, something went wrong.
|
Thanks zhangyangyu and merwok, I have made a update as your suggestions. |
Sorry, something went wrong.
|
It's just my question. I am not sure which is actually wanted. But at least if you change it, the footprint link is not needed either. |
Sorry, something went wrong.
|
I think that people may use I don’t know if the keys method pre-dates the iteration protocol, but given that keys was never deprecated, to me it’s an indication that it’s fine if people use it, even if it’s technically redundant. Here in the tutorial, I would go for not changing it. |
Sorry, something went wrong.
But tutorial should teach preferred way, not redundant way? |
Sorry, something went wrong.
…dict is now guaranteed.
JulienPalard
left a comment
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be poked with soft cushions! |
Sorry, something went wrong.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
|
Thanks for making the requested changes! @zhangyangyu, @JulienPalard, @merwok: please review the changes made to this pull request. |
Sorry, something went wrong.
|
Document somewhere that two dicts with same contents, but different order of key-value pairs are equal. i.e. It is not obvious, and I needed to check that before use. |
Sorry, something went wrong.
|
@socketpair Dict equality is already documented to not rely on order. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Let's merge this as-is. We discussed long enough. |
Sorry, something went wrong.
|
Thanks @shangdahao for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
(cherry picked from commit dfbbbf1) Co-authored-by: hui shang <shangdahao@gmail.com>

https://bugs.python.org/issue32337