bpo-36465: Fix test_regrtest on Windows by vstinner · Pull Request #12945 · python/cpython
Py_DEBUG implies Py_REF_DEBUG.
Special gimmicks:
sys.gettotalrefcount()
Build option: ``./configure --with-trace-refs``.
Turn on heavy reference debugging. This is major surgery. Every PyObject grows two more pointers, to maintain a doubly-linked list of all live heap-allocated objects. Most built-in type objects are not in this list, as they're statically
Py_TRACE_REFS implies Py_REF_DEBUG.
Special gimmicks:
sys.getobjects(max[, type])
Note that PYMALLOC_DEBUG requires WITH_PYMALLOC. Note that PYMALLOC_DEBUG requires WITH_PYMALLOC. Py_DEBUG implies PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled).
Special gimmicks:
This is what is generally meant by "a debug build" of Python.
Py_DEBUG implies LLTRACE, Py_REF_DEBUG, Py_TRACE_REFS, and PYMALLOC_DEBUG (if Py_DEBUG implies LLTRACE, Py_REF_DEBUG, and PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled). In addition, C assert()s are enabled (via the C way: by not defining NDEBUG), and some routines do additional sanity checks inside "#ifdef Py_DEBUG" blocks.
Not useful very often, but very useful when needed.
Py_DEBUG implies LLTRACE.