Skip to content

bpo-33609: Add document for dict order#7093

Merged
ned-deily merged 2 commits into
python:masterfrom
methane:doc-dict-order
Jun 4, 2018
Merged

bpo-33609: Add document for dict order#7093
ned-deily merged 2 commits into
python:masterfrom
methane:doc-dict-order

Conversation

@methane

@methane methane commented May 24, 2018

Copy link
Copy Markdown
Member

@1st1 1st1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about deletion? Does it scramble the order or does it preserve it? What are the guarantees?

@methane

methane commented May 24, 2018

Copy link
Copy Markdown
Member Author

"Preserves insertion order" is guaranteed for deletion too.

@1st1

1st1 commented May 24, 2018

Copy link
Copy Markdown
Member

Can you clarify that in the docs? ideally with a 3-4 lines example.

@methane

methane commented May 24, 2018

Copy link
Copy Markdown
Member Author

"Scramble on deletion" was implementation detail of original Raymond's compact dict.
So adding sentence like "Insertion order is preserved after deletion" may confuse readers.

Instead, I added one sentence about "insert after deletion" case. It had example already.
With this example, reader will understand "preserve insertion order after deletion" clearly.

@ned-deily

Copy link
Copy Markdown
Member

@1st1 Are you OK with the revised wording?

@1st1

1st1 commented Jun 4, 2018

Copy link
Copy Markdown
Member

Yes, I think the updated text is great. Thanks, @methane!

@ned-deily ned-deily merged commit f822549 into python:master Jun 4, 2018
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @methane for the PR, and @ned-deily for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot

Copy link
Copy Markdown

GH-7407 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 4, 2018
…H-7093)

(cherry picked from commit f822549)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Jun 4, 2018
(cherry picked from commit f822549)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
@methane methane deleted the doc-dict-order branch June 5, 2018 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants