◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
21 changes: 18 additions & 3 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ PyConfig

Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable.

Need a special build of Python with the ``Py_TRACE_REFS`` macro defined:
see the :option:`configure --with-trace-refs option <--with-trace-refs>`.

Default: ``0``.
Expand Up @@ -1048,7 +1048,7 @@ PyConfig
Incremented by the :option:`-d` command line option. Set to the
:envvar:`PYTHONDEBUG` environment variable value.

Need a :ref:`debug build of Python <debug-build>` (the ``Py_DEBUG`` macro
must be defined).

Default: ``0``.
Expand Down Expand Up @@ -1100,6 +1100,7 @@ PyConfig

Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and
the :envvar:`PYTHONPYCACHEPREFIX` environment variable.

If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``.

Expand Down Expand Up @@ -1143,13 +1144,27 @@ PyConfig

Default: ``NULL``.

.. c:member:: int show_ref_count

Show total reference count at exit (excluding immortal objects)?

Set to ``1`` by :option:`-X showrefcount <-X>` command line option.

Need a :ref:`debug build of Python <debug-build>` (the ``Py_REF_DEBUG``
macro must be defined).

Default: ``0``.
37 changes: 33 additions & 4 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,12 @@ Miscellaneous options
This option may be useful for users who need to limit CPU resources of a
container system. See also :envvar:`PYTHON_CPU_COUNT`.
If *n* is ``default``, nothing is overridden.

It also allows passing arbitrary values and retrieving them through the
:data:`sys._xoptions` dictionary.
Expand Down Expand Up @@ -602,6 +608,9 @@ Miscellaneous options
.. versionadded:: 3.13
The ``-X cpu_count`` option.


Options you shouldn't use
~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -1090,13 +1099,33 @@ Debug-mode variables
If set, Python will dump objects and reference counts still alive after
shutting down the interpreter.

Need Python configured with the :option:`--with-trace-refs` build option.

.. envvar:: PYTHONDUMPREFSFILE=FILENAME

If set, Python will dump objects and reference counts still alive
after shutting down the interpreter into a file called *FILENAME*.

Need Python configured with the :option:`--with-trace-refs` build option.

.. versionadded:: 3.11
10 changes: 10 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1348,3 +1348,13 @@ removed, although there is currently no date scheduled for their removal.

* Remove undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API.
(Contributed by Victor Stinner in :gh:`110014`.)
6 changes: 6 additions & 0 deletions Include/cpython/initconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ typedef struct PyConfig {
// If non-zero, turns on statistics gathering.
int _pystats;
#endif
} PyConfig;

PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Toggle all file notes Toggle all file annotations