GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Add Py_SETREF() and Py_XSETREF() macros to the limited C API 3.12 · Issue #99574 · python/cpython Closed Labels type-featureA feature request or enhancementA feature request or enhancement DescriptionThe Py_SETREF() and Py_XSETREF() macros were added to Python 3.6 (and 3.5.2) in 2016 with commit 57a01d3. In 2017, Serhiy @serhiy-storchaka proposed to add these two macros to the limited C API: https://mail.python.org/archives/list/[email protected]/thread/HGBT2Y4VAZOOU5XI2RPSURDGFBMRJKPO/ But these macros were not added. Py_CLEAR() is already part of the limited C API (since Python 3.2) and is very similar to Py_SETREF(). Py_CLEAR() rely on the C preprocessor to get a reference to a variable, so the variable can be set to Multiple projects use these macros. Code search in PyPI top 5000 projects using
numpy and the pythoncapi-compat project (code) define these macros on Python older than 3.5.2. I propose to add Py_SETREF() and Py_XSETREF() macros to the limited C API of Python 3.12. By the way, I recently documented these two macros in Python 3.12 (commit c03e05c): https://docs.python.org/dev/c-api/refcounting.html#c.Py_SETREF See also issue #98724 and its PR #99100 which discuss Py_CLEAR(), Py_SETREF() and Py_XSETREF() in length. I would prefer exposing functions (taking a reference to a variable, Linked PRsActivity
MetadataMetadataAssigneesLabelstype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| 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. |