Title: Proposal to add `Py_IsFinalizing()` to the limited API/stable ABI · Issue #110397 · python/cpython · GitHub
Open Graph Title: Proposal to add `Py_IsFinalizing()` to the limited API/stable ABI · Issue #110397 · python/cpython
X Title: Proposal to add `Py_IsFinalizing()` to the limited API/stable ABI · Issue #110397 · python/cpython
Description: Feature or enhancement Proposal: Bigger Python extension projects sometimes need to check whether the interpreter is in the process of shutting down to determine if certain operations may be safely executed (PyEval_RestoreThread, Py_DECR...
Open Graph Description: Feature or enhancement Proposal: Bigger Python extension projects sometimes need to check whether the interpreter is in the process of shutting down to determine if certain operations may be safely...
X Description: Feature or enhancement Proposal: Bigger Python extension projects sometimes need to check whether the interpreter is in the process of shutting down to determine if certain operations may be safely...
Opengraph URL: https://github.com/python/cpython/issues/110397
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal to add `Py_IsFinalizing()` to the limited API/stable ABI","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nBigger Python extension projects sometimes need to check whether the interpreter is in the process of shutting down to determine if certain operations may be safely executed (`PyEval_RestoreThread`, `Py_DECREF`, etc.). Making a mistake here would cause a segfault, and the functions `Py_IsFinalizing` (previously `_Py_IsFinalizing`) are important to keep that from happening.\n\nJust recently, this function was deleted, then re-added to the public API (https://github.com/python/cpython/issues/108014). However, it is not part of the *limited API* and therefore cannot be used in extension modules targeting the *stable ABI*.\n\nThe purpose of this ticket is to start a discussion on whether this function could be exposed as part of these longer-term stable interfaces.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-110441\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/wjakob","@type":"Person","name":"wjakob"},"datePublished":"2023-10-05T13:35:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/110397/cpython/issues/110397"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fc012652-5234-7e85-0215-775dfddc218c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E5A:3545E1:12313DC:178AB7F:696B12E7 |
| html-safe-nonce | a22384ad5b6f38b8f840dd2bdf1be0e2c3e3572091c858f0d971897a64b5933e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTVBOjM1NDVFMToxMjMxM0RDOjE3OEFCN0Y6Njk2QjEyRTciLCJ2aXNpdG9yX2lkIjoiMzE5MTAwMjI2OTk0MzAxMDAyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a7eb70a4cbcab3ebbd75ad3a76ee0c4bd2559a7efd48e4b58b1d1cec9e9b3291 |
| hovercard-subject-tag | issue:1928314178 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/110397/issue_layout |
| twitter:image | https://opengraph.githubassets.com/026e755a7363859f86da45fb49940244b1916e5102595e4a79ad66cf497ce778/python/cpython/issues/110397 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/026e755a7363859f86da45fb49940244b1916e5102595e4a79ad66cf497ce778/python/cpython/issues/110397 |
| og:image:alt | Feature or enhancement Proposal: Bigger Python extension projects sometimes need to check whether the interpreter is in the process of shutting down to determine if certain operations may be safely... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wjakob |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width