Skip to content

bpo-45735: Promise the long-time truth that args=list works #30982

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 15 commits into from
Feb 26, 2022

Conversation

CharlieZhao95
Copy link
Contributor

@CharlieZhao95 CharlieZhao95 commented Jan 28, 2022

Change description of threading.Thread to explain the validity of list args.

Add doc example and test cases for threading.Thread.

https://bugs.python.org/issue45735

Copy link
Member

@tim-one tim-one left a comment

Choose a reason for hiding this comment

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

So far, so good! Similar changes are needed for multiprocessing.Process (in file multiprocessing.rst), for its args argument.

@tim-one tim-one requested a review from rhettinger January 28, 2022 19:35
@tim-one
Copy link
Member

tim-one commented Jan 28, 2022

@rhettinger, you closed your old PR on this without leaving a clue as to why. If you object to documenting this now, please say so.

Copy link
Member

@tim-one tim-one left a comment

Choose a reason for hiding this comment

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

You should also add your name to Misc/ACKS.

@CharlieZhao95
Copy link
Contributor Author

So far, so good! Similar changes are needed for multiprocessing.Process (in file multiprocessing.rst), for its args argument.

OK, I am going to submit the relevant code on this PR (Previously, I plan to open a new PR for multiprocessing ).😉

Copy link
Member

@tim-one tim-one left a comment

Choose a reason for hiding this comment

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

Looking good! I suggested some changes for clearer English. You should be able to just a click a button to accept them, if you agree with them.

@bedevere-bot
Copy link

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.

@tim-one tim-one changed the title bpo-45735: Promised that lists can be used for Thread args. bpo-45735: Promise the long-time truth that args=list works Jan 29, 2022
CharlieZhao95 and others added 2 commits January 29, 2022 14:17
Cleaner English here.

Co-authored-by: Tim Peters <[email protected]>
Cleaner English to describe *args*.

Co-authored-by: Tim Peters <[email protected]>
@CharlieZhao95 CharlieZhao95 requested a review from tim-one February 1, 2022 13:35
@CharlieZhao95
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@tim-one: please review the changes made to this pull request.

Copy link
Member

@shihai1991 shihai1991 left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

@tim-one tim-one merged commit e466faa into python:main Feb 26, 2022
asvetlov pushed a commit that referenced this pull request Feb 26, 2022
For threads, and for multiprocessing, it's always been the case that ``args=list`` works fine when passed to ``Process()`` or ``Thread()``, and such code is common in the wild. But, according to the docs, only a tuple can be used. This brings the docs into synch with reality.

Doc changes by Charlie Zhao.
Co-authored-by: Tim Peters <[email protected]>
@vstinner
Copy link
Member

The added test leaks threads running in the background: I wrote #92885 to fix this issue.

@tim-one
Copy link
Member

tim-one commented May 17, 2022

Thank you, Victor! 😄

1 similar comment
@tim-one
Copy link
Member

tim-one commented May 17, 2022

Thank you, Victor! 😄

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.

7 participants