GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Py_IsFinalizing() by vstinner · Pull Request #66 · python/pythoncapi-compat

Conversation

@vstinner

@vstinner vstinner commented Aug 16, 2023

Copy link
Copy Markdown
Member

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner

vstinner commented Aug 16, 2023

Copy link
Copy Markdown
Member Author

PR waiting until python/cpython#108032 is merged in Python upstream.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request Aug 16, 2023
gh-108014: Add Py_IsFinalizing() function python/cpython#108032
Merged
@vstinner
vstinner force-pushed the is_finalizing branch from b7bac03 to e0c2c0a Compare August 16, 2023 16:05
@albanD

albanD commented Aug 16, 2023

Copy link
Copy Markdown
Contributor

Hey!

I have a related question but it is not 100% about this PR so feel free to delete if you think this is not the right place to ask.

There have been quite a few discussions related to Py_IsFinalizing and Py_Initialized and how to use them to ensure graceful exit when c++ keeps things alive past python runtime lifetime.
https://github.com/pytorch/pytorch/blob/589072afa1a196270b0298460c1f419e209da6ea/torch/csrc/utils/pybind.h#L178-L185

Is this comment still accurate for the latest version of CPython? Should we update our use of these functions to use the new public API being introduced?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Aug 16, 2023

Copy link
Copy Markdown
Member Author

Is this comment still accurate for the latest version of CPython?

I don't know. This PR is on the pythoncapi-compat project, not the Python project.

albanD reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
Add Py_IsFinalizing()
9717eb1
@vstinner
vstinner force-pushed the is_finalizing branch from e0c2c0a to 9717eb1 Compare August 18, 2023 10:43
@vstinner
vstinner marked this pull request as ready for review August 18, 2023 10:43
erlend-aasland
erlend-aasland approved these changes Aug 18, 2023
View reviewed changes
@vstinner
vstinner merged commit 1bb4e16 into main Aug 18, 2023
@vstinner
vstinner deleted the is_finalizing branch August 18, 2023 10:47
@vstinner

vstinner commented Aug 18, 2023

Copy link
Copy Markdown
Member Author

I dug into PyPy tarball releases to check which version added Py_IsFinalizing(): it's PyPy 7.3. Sadly, on GitHub Actions we only tests versions newer than PyPy 7.3.0: PyPy 7.2 and older are not tested.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @albanD @erlend-aasland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.