Skip to content

gh-129948: Add set() to multiprocessing.managers.SyncManager #129949

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 40 commits into from
Feb 23, 2025

Conversation

mmingyu
Copy link
Contributor

@mmingyu mmingyu commented Feb 10, 2025

Resolve : #129948

The SyncManager provides support for various data structures such as dict, list, and queue, but oddly, it does not support set. This inconsistency feels little bit weird.

This PR introduces support for set by defining SetProxy and registering it with SyncManager.

@mmingyu mmingyu requested a review from gpshead as a code owner February 10, 2025 10:51
@ghost
Copy link

ghost commented Feb 10, 2025

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Feb 10, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Feb 10, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@mmingyu mmingyu changed the title gh-129948: Add set() Support to multiprocessing.managers.SyncManager gh-129948: Add set() to multiprocessing.managers.SyncManager Feb 10, 2025
@bedevere-app
Copy link

bedevere-app bot commented Feb 11, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

may be some description regarding why adding this would be beneficiary is helpful to understand the reasoning

@mmingyu
Copy link
Contributor Author

mmingyu commented Feb 11, 2025

may be some description regarding why adding this would be beneficiary is helpful to understand the reasoning

Thanks for the advice!
Are you suggesting that I should make the PR description more detailed? I've updated the PR description

Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

yes it seems more clear now

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

New features require a full-fleded What's New Entry (in Doc/whatsnew/3.14.rst in this case) as well as an updated documentation (likely in Doc/library/multiprocessing.rst). Please add them as well.

@bedevere-app
Copy link

bedevere-app bot commented Feb 11, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@mmingyu mmingyu requested a review from picnixz February 23, 2025 01:22
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

Some final nits and I think we're good (but we'll need to wait for @gpshead's review because he's the mp's expert, I'm not).

@picnixz
Copy link
Member

picnixz commented Feb 23, 2025

I've merged main into the branch because I think the CI has changed.

In addition, please avoid force-pushing in general. We squash-merge at the end, and force-pushing makes incremental reviews harder. TiA.

@gpshead gpshead self-assigned this Feb 23, 2025
@gpshead gpshead added the type-feature A feature request or enhancement label Feb 23, 2025
@gpshead gpshead enabled auto-merge (squash) February 23, 2025 19:27
@gpshead gpshead merged commit 9f81f82 into python:main Feb 23, 2025
41 checks passed
@picnixz
Copy link
Member

picnixz commented Feb 23, 2025

Thank you for the contribution @mmingyu and for the review @gpshead !

mmingyu added a commit to mmingyu/typeshed that referenced this pull request Feb 25, 2025
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
python#129949)

The SyncManager provided support for various data structures such as dict, list, and queue, but oddly, not set.
This introduces support for set by defining SetProxy and registering it with SyncManager.

---
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Gregory P. Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add set() to multiprocessing.managers.SyncManager
4 participants