Skip to content

bpo-33609: Add document for dict order #7093

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

Merged
merged 2 commits into from
Jun 4, 2018

Conversation

methane
Copy link
Member

@methane methane commented May 24, 2018

Copy link
Member

@1st1 1st1 left a comment

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
Copy link
Member Author

methane commented May 24, 2018

"Preserves insertion order" is guaranteed for deletion too.

@1st1
Copy link
Member

1st1 commented May 24, 2018

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

@methane
Copy link
Member Author

methane commented May 24, 2018

"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
Member

@1st1 Are you OK with the revised wording?

@1st1
Copy link
Member

1st1 commented Jun 4, 2018

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
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

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
miss-islington added a commit that referenced this pull request Jun 4, 2018
@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