New submission from STINNER Victor <vstin...@redhat.com>:

The _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros are documented:

* https://docs.python.org/dev/c-api/gcsupport.html#c._PyObject_GC_TRACK
* https://docs.python.org/dev/c-api/gcsupport.html#c._PyObject_GC_UNTRACK

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.

----------
messages: 329829
nosy: vstinner
priority: normal
severity: normal
status: open
title: Deprecate _PyObject_GC_TRACK() in Python 3.6
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35229>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to