8000 gh-105268: Remove _PyGC_FINALIZED() macro by vstinner · Pull Request #105350 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-105268: Remove _PyGC_FINALIZED() macro #105350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,10 @@ Removed
* or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`.

(Contributed by Victor Stinner in :gh:`105182`.)

* Remove the old private, undocumented and untested ``_PyGC_FINALIZED()`` macro
which was kept for backward compatibility with Python 3.8 and older: use
:c:func:`PyObject_GC_IsFinalized()` instead. The `pythoncapi-compat project
<https://github.com/python/pythoncapi-compat/>`_ can be used to get this
function on Python 3.8 and older.
(Contributed by Victor Stinner in :gh:`105268`.)
8 changes: 0 additions & 8 deletions Include/cpython/objimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);


/* Code built with Py_BUILD_CORE must include pycore_gc.h instead which
defines a different _PyGC_FINALIZED() macro. */
#ifndef Py_BUILD_CORE
// Kept for backward compatibility with Python 3.8
# define _PyGC_FINALIZED(o) PyObject_GC_IsFinalized(o)
#endif


// Test if a type supports weak references
PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Remove the old private, undocumented and untested ``_PyGC_FINALIZED()`` macro
which was kept for backward compatibility with Python 3.8 and older. Patch by
Victor Stinner.
0