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

gh-87063: Add closed attribute to multiprocessing.Process #125838

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

rruuaanng
Copy link
Contributor

@rruuaanng rruuaanng commented Oct 22, 2024

for example:

import multiprocessing


def f():
    print('hello')
    print('world')

if __name__ == "__main__":
    p = multiprocessing.Process(target=f)
    p.start()
    p.join()

    # In a more context, it's closed
    p.close()
    
    # Currnet context
    # It's thrown a ValueError
    if p.exitcode == 0:
        pass

    # Changed
    if not p.is_closed():
        print(p.exitcode)

@rruuaanng
Copy link
Contributor Author

It seems that this NEWS error can be ignored.

Copy link
Contributor

@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.

More generally, required CI checks must never be ignored except for NEWS missing / issue missing since normal users cannot apply the skip news/issue labels themselves.

Lib/test/_test_multiprocessing.py Outdated Show resolved Hide resolved
Lib/multiprocessing/process.py Show resolved Hide resolved
Doc/library/multiprocessing.rst Outdated Show resolved Hide resolved
Doc/library/multiprocessing.rst Outdated Show resolved Hide resolved
Lib/test/_test_multiprocessing.py Outdated Show resolved Hide resolved
@erlend-aasland erlend-aasland changed the title gh-87063: Add is_closed method to multiprocessing.Process gh-87063: Add is_closed attribute to multiprocessing.Process Oct 25, 2024
@erlend-aasland erlend-aasland changed the title gh-87063: Add is_closed attribute to multiprocessing.Process gh-87063: Add closed attribute to multiprocessing.Process Oct 25, 2024
Comment on lines 1 to 2
Allow to determine whether a :class:`multiprocessing.Process` has been closed
via the :attr:`~multiprocessing.Process.closed` attribute.
Copy link
Contributor

Choose a reason for hiding this comment

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

@rruuaanng: I encourage you strongly to read the devguide. This change is a new feature, so it needs a What's New entry. Please take a look at existing What's New entries for inspiration!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if the new changes are satisfactory, but I read what's under Doc/whatnews :). Please review it again!

Copy link
Contributor

Choose a reason for hiding this comment

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

No. I will repeat again: please read the devguide. If you don't, you will continue to waste review resources.

New features (and especially any new API, like this is) will need a What's New entry. I linked to the section in the devguide that talks about What's New entries, and I also asked you to look at existing entries for inspiration. Apparently, nothing of this was done.

I'll ask you again: please take a look at how we word NEWS and What's New entries for new APIs, and adapt your PR to follow our conventions. Please listen to advice.

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

PR author did not listen to feedback. Requesting changes to make this point clearer.

@bedevere-app
Copy link

bedevere-app bot commented Oct 26, 2024

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.

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.

3 participants