Skip to content

Commit c7667a2

Browse files
authoredMay 24, 2022
gh-93103: Enhance PyConfig.parser_debug documentation (#93186)
Document that -d option and PYTHONDEBUG env var require a debug build of Python. Also mention them in the debug build documentation.
1 parent fbd11f3 commit c7667a2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed
 

‎Doc/c-api/init_config.rst

+3
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,9 @@ PyConfig
986986
Incremented by the :option:`-d` command line option. Set to the
987987
:envvar:`PYTHONDEBUG` environment variable value.
988988
989+
Need a :ref:`debug build of Python <debug-build>` (the ``Py_DEBUG`` macro
990+
must be defined).
991+
989992
Default: ``0``.
990993
991994
.. c:member:: int pathconfig_warnings

‎Doc/using/cmdline.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,11 @@ Miscellaneous options
248248

249249
.. cmdoption:: -d
250250

251-
Turn on parser debugging output (for expert only, depending on compilation
252-
options). See also :envvar:`PYTHONDEBUG`.
251+
Turn on parser debugging output (for expert only).
252+
See also the :envvar:`PYTHONDEBUG` environment variable.
253+
254+
This option requires a :ref:`debug build of Python <debug-build>`, otherwise
255+
it's ignored.
253256

254257

255258
.. cmdoption:: -E
@@ -660,6 +663,9 @@ conflict.
660663
:option:`-d` option. If set to an integer, it is equivalent to specifying
661664
:option:`-d` multiple times.
662665

666+
This environment variable requires a :ref:`debug build of Python
667+
<debug-build>`, otherwise it's ignored.
668+
663669

664670
.. envvar:: PYTHONINSPECT
665671

‎Doc/using/configure.rst

+2
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ Effects of a debug build:
278278
* Add ``d`` to :data:`sys.abiflags`.
279279
* Add :func:`sys.gettotalrefcount` function.
280280
* Add :option:`-X showrefcount <-X>` command line option.
281+
* Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment
282+
variable to debug the parser.
281283
* Add support for the ``__lltrace__`` variable: enable low-level tracing in the
282284
bytecode evaluation loop if the variable is defined.
283285
* Install :ref:`debug hooks on memory allocators <default-memory-allocators>`

0 commit comments

Comments
 (0)
Please sign in to comment.