Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commented Aug 16, 2023

@vstinner
Copy link
MemberAuthor

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

@vstinner
Copy link
MemberAuthor

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

@gvanrossumgvanrossum removed their request for review August 16, 2023 18:05
Comment on lines 378 to 379
Return non-zero if the Python interpreter is :term:`shutting down
<interpreter shutdown>`, return 0 otherwise.

Choose a reason for hiding this comment

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

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
MemberAuthor

Choose a reason for hiding this comment

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

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
MemberAuthor

Choose a reason for hiding this comment

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

I updated the doc to specify that we are talking about the main interpreter.

@kumaraditya303kumaraditya303 removed their request for review August 17, 2023 06:08
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

vstinnerand 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>
@vstinnervstinner merged commit 3ff5ef2 into python:mainAug 18, 2023
@vstinnervstinner deleted the is_finalizing branch August 18, 2023 10:34
@vstinner
Copy link
MemberAuthor

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

@vstinner
Copy link
MemberAuthor

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@vstinner@ericsnowcurrently@serhiy-storchaka@bedevere-bot