You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecate _PyObject_GC_TRACK() in Python 3.6 #79410
The documentation says "It should not be used for extension modules."
These macros have been broken in Python 3.7 by Eric Snow's work on moving internal APIs to Include/internal/: _PyObject_GC_TRACK() access _PyRuntime.gc.generation0, whereas accessing _PyRuntime requires to include Include/internal/pycore_pystate.h (header previously called Include/internal/pystate.h in Python 3.7) which is not installed by "make install".
My PR 10507 moved these macros to Include/internal/ to clarify that they must not be used outside CPython internals.
I suggest to deprecate them in Python 3.6: just add a note in Python 3.6 and 3.7 documentation.
Activity
vstinner commentedon Nov 13, 2018
The _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros are documented:
The documentation says "It should not be used for extension modules."
These macros have been broken in Python 3.7 by Eric Snow's work on moving internal APIs to Include/internal/: _PyObject_GC_TRACK() access _PyRuntime.gc.generation0, whereas accessing _PyRuntime requires to include Include/internal/pycore_pystate.h (header previously called Include/internal/pystate.h in Python 3.7) which is not installed by "make install".
My PR 10507 moved these macros to Include/internal/ to clarify that they must not be used outside CPython internals.
I suggest to deprecate them in Python 3.6: just add a note in Python 3.6 and 3.7 documentation.
vstinner commentedon Nov 13, 2018
Oh, I forgot to mention that IMHO it's perfectly fine :-)
vstinner commentedon Nov 13, 2018
New changeset 55b4771 by Victor Stinner in branch '3.7':
bpo-35229: Deprecate _PyObject_GC_TRACK() (GH-10511)
55b4771
miss-islington commentedon Nov 13, 2018
New changeset 60a6bae by Miss Islington (bot) in branch '3.6':
bpo-35229: Deprecate _PyObject_GC_TRACK() (GH-10511)
60a6bae