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

gh-108014: Add Py_IsFinalizing() function by vstinner · Pull Request #108032 · python/cpython · GitHub

/ cpython Public

gh-108014: Add Py_IsFinalizing() function - #108032

Merged
vstinner merged 5 commits into
python:mainfrom
vstinner:is_finalizing
Aug 18, 2023
Merged

gh-108014: Add Py_IsFinalizing() function#108032
vstinner merged 5 commits into
python:mainfrom
vstinner:is_finalizing

Conversation

vstinner commented Aug 16, 2023
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

@ericsnowcurrently: Oh, that's a "feature" PR, so I will need a formal approval to merge it :-)

Copy link
Copy Markdown
Member Author

I prepared python/pythoncapi-compat#66 to add the function to the pythoncapi-compat project.

gvanrossum removed their request for review August 16, 2023 18:05
Comment thread Doc/c-api/init.rst Outdated
Comment on lines +378 to +379
Return non-zero if the Python interpreter is :term:`shutting down
<interpreter shutdown>`, return 0 otherwise.

Copy link
Copy Markdown
Member

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

Is this referring to the runtime (AKA main interpreter) or to the current interpreter? I'd expect it to be the current interpreter.

Would it make sense to explicitly pass an interpreter and use NULL to mean the current one (or main)?

Copy link
Copy Markdown
Member Author

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 copied the documentation of the sys.is_finalizing() function. If you want a different feature (pass an interpreter), I would prefer to have a different function.

It's set by Py_Finalize() which finalizes the main interpreter: other sub-interpreters should be deleted before explicitly, no?

Copy link
Copy Markdown
Member Author

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 updated the doc to specify that we are talking about the main interpreter.

Comment thread Doc/c-api/init.rst
Comment thread Doc/c-api/init.rst Outdated
kumaraditya303 removed their request for review August 17, 2023 06:08

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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

LGTM.

Comment thread Doc/c-api/init.rst
Comment thread Doc/whatsnew/3.13.rst Outdated
vstinner and others added 2 commits August 17, 2023 22:01
…3CF.rst

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
vstinner merged commit 3ff5ef2 into python:main Aug 18, 2023
vstinner deleted the is_finalizing branch August 18, 2023 10:34

Copy link
Copy Markdown
Member Author

Thanks for the review @ericsnowcurrently and @serhiy-storchaka!

vstinner commented Oct 5, 2023

Copy link
Copy Markdown
Member Author

Follow-up: @wjakob asks to add this new function to the limited C API version 3.13.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL