Skip to content

bpo-40890: Add mapping attribute to dict views#20691

Closed
sweeneyde wants to merge 4 commits into
python:masterfrom
sweeneyde:dictview_mapping
Closed

bpo-40890: Add mapping attribute to dict views#20691
sweeneyde wants to merge 4 commits into
python:masterfrom
sweeneyde:dictview_mapping

Conversation

@sweeneyde

@sweeneyde sweeneyde commented Jun 7, 2020

Copy link
Copy Markdown
Member

@remilapeyre remilapeyre left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think MappingView in collections.abc will also need to be updated.

Comment thread Doc/library/stdtypes.rst Outdated
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
@sweeneyde

Copy link
Copy Markdown
Member Author

I think MappingView in collections.abc will also need to be updated.

I'm not convinced the spec should change. I wouldn't want to make it so that some user class is no longer implementing the MappingView interface if it had already registered as a MappingView but doesn't (or maybe even can't?) have a mapping property. For precedent, the dict views have __reversed__ methods, while MappingView has remained without. It seems that most of the ABC interfaces that have existed since the creation of the ABC module have remained stable ever since.

@sweeneyde sweeneyde closed this Jun 9, 2020
@sweeneyde
sweeneyde deleted the dictview_mapping branch April 5, 2022 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants