FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

inheritance for multiprocessing.managers.DictProxy by tungol · Pull Request #12893 · python/typeshed · GitHub

inheritance for multiprocessing.managers.DictProxy - #12893

Closed
tungol wants to merge 4 commits into
python:mainfrom
tungol:DictProxy
Closed

inheritance for multiprocessing.managers.DictProxy#12893
tungol wants to merge 4 commits into
python:mainfrom
tungol:DictProxy

Conversation

tungol commented Oct 24, 2024

Copy link
Copy Markdown
Contributor

Similar to #12873 and #12892

DictProxy doesn't inherit from MutableMapping and it isn't registered to it either. It does have all the relevant methods.

tungol marked this pull request as draft October 24, 2024 05:19

This comment has been minimized.

tungol marked this pull request as ready for review October 24, 2024 06:57

This comment has been minimized.

tungol commented Oct 24, 2024

Copy link
Copy Markdown
Contributor Author

I'm honestly kind of surprised all three of these turned out to be "no effect".

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Copy Markdown
Member

I'm honestly kind of surprised all three of these turned out to be "no effect".

I think they're used somewhat rarely; I wouldn't be surprised if there's no mypy_primer coverage for them. They are used, though; we've had bug reports in the past about them when I caused a regression.

tungol commented Oct 24, 2024

Copy link
Copy Markdown
Contributor Author

That makes sense.

srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm in favor of changes like this, especially when there's no primer impact. It's also a chance to steer users towards using protocols. (In the long term we should also look into adding some "mapping light" protocols to typing. Similar to what I suggested for Reader/Writer protocols (which I need to prepare a PR for).)

Copy link
Copy Markdown
Member

I'm a bit nervous about this, because sort-of the whole point of this class is that it's meant to be basically drop-in compatible with dict. I think it almost certainly should be registered to the ABC at runtime :/

tungol commented Nov 5, 2024

Copy link
Copy Markdown
Contributor Author

I've opened a cpython issue and MR to get this and BaseListProxy registered to their ABCs at runtime.

python/cpython#126417

python/cpython#126419

tungol commented Nov 6, 2024

Copy link
Copy Markdown
Contributor Author

This is now fixed in cpython for 3.12 and up. It probably doesn't make sense to branch for the sake of 3.8 to 3.11.

tungol closed this Nov 6, 2024
tungol deleted the DictProxy branch November 7, 2024 21:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL