Skip to content
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

Register multiprocessing proxy types to an appropriate collections.abc class #126417

Closed
tungol opened this issue Nov 5, 2024 · 3 comments
Closed
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@tungol
Copy link
Contributor

tungol commented Nov 5, 2024

Feature or enhancement

Proposal:

For consistency with the types that they proxy, I believe that multiprocessing.managers.ListProxy should be registered to collections.abc.MutableSequence and multiprocessing.managers.DictProxy should be registered to collections.abc.MutableMapping. This could be done by registering either those types themselves or by registering their base classes, BaseListProxy and _BaseDictProxy.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

I discovered that these weren't registered to their ABCs while working on typeshed, so a little previous discussion occurred in issues in that repo:

python/typeshed#12893

python/typeshed#12892

Linked PRs

@tungol tungol added the type-feature A feature request or enhancement label Nov 5, 2024
@ZeroIntensity ZeroIntensity added the stdlib Python modules in the Lib dir label Nov 5, 2024
AlexWaygood pushed a commit to AlexWaygood/cpython that referenced this issue Nov 5, 2024
…propriate collections.abc class (python#126419)

(cherry-picked from commit 78842e4)
AlexWaygood pushed a commit to AlexWaygood/cpython that referenced this issue Nov 5, 2024
…propriate collections.abc class (python#126419)

(cherry-picked from commit 78842e4)
AlexWaygood added a commit that referenced this issue Nov 5, 2024
…ate collections.abc class (#126419) (#126436)

Co-authored-by: Stephen Morton <[email protected]>
AlexWaygood added a commit that referenced this issue Nov 5, 2024
…ate collections.abc class (#126419) (#126435)

Co-authored-by: Stephen Morton <[email protected]>
@AlexWaygood
Copy link
Member

Thanks @tungol!

gpshead pushed a commit that referenced this issue Nov 11, 2024
Checks that appropriate dunder __ methods exist on the dict and list proxy types.

Co-authored-by: Alex Waygood <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 11, 2024
…ythonGH-126454)

Checks that appropriate dunder __ methods exist on the dict and list proxy types.

(cherry picked from commit 6ee542d)

Co-authored-by: Stephen Morton <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 11, 2024
…ythonGH-126454)

Checks that appropriate dunder __ methods exist on the dict and list proxy types.

(cherry picked from commit 6ee542d)

Co-authored-by: Stephen Morton <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
@gpshead
Copy link
Member

gpshead commented Nov 11, 2024

FYI - The backports of the validation test don't work on 3.13 or earlier because ListProxy in those versions does not have the methods added to 3.14 by #103133.

I'll close those backports.

@AlexWaygood
Copy link
Member

The backports of the original PR are being reverted in:

(We're not reverting it for 3.14+, it's a good change! But there were concerns raised in #126451 over whether it was a good idea to backport this kind of change, and I think those concerns were reasonable.)

picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 8, 2024
picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 8, 2024
…ython#126454)

Checks that appropriate dunder __ methods exist on the dict and list proxy types.

Co-authored-by: Alex Waygood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants