diff options
author | Gregory P. Smith <greg@krypto.org> | 2022-10-03 20:55:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 20:55:45 (GMT) |
commit | b0f89cb4311b696f875e58f14258ce315be09bce (patch) | |
tree | c387a1482f5b7c1a12061cf0f755835cf95a6a71 /Doc/c-api | |
parent | cfbc7dd91059cb663c7fe13c661665943495ed7f (diff) | |
download | cpython-b0f89cb4311b696f875e58f14258ce315be09bce.zip cpython-b0f89cb4311b696f875e58f14258ce315be09bce.tar.gz cpython-b0f89cb4311b696f875e58f14258ce315be09bce.tar.bz2 |
gh-96512: Move int_max_str_digits setting to PyConfig (#96944)
It had to live as a global outside of PyConfig for stable ABI reasons in
the pre-3.12 backports.
This removes the `_Py_global_config_int_max_str_digits` and gets rid of
the equivalent field in the internal `struct _is PyInterpreterState` as
code can just use the existing nested config struct within that.
Adds tests to verify unique settings and configs in subinterpreters.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/init_config.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index c4a342e..ea76315 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -828,6 +828,24 @@ PyConfig Default: ``0``. + .. c:member:: int int_max_str_digits + + Configures the :ref:`integer string conversion length limitation + <int_max_str_digits>`. An initial value of ``-1`` means the value will + be taken from the command line or environment or otherwise default to + 4300 (:data:`sys.int_info.default_max_str_digits`). A value of ``0`` + disables the limitation. Values greater than zero but less than 640 + (:data:`sys.int_info.str_digits_check_threshold`) are unsupported and + will produce an error. + + Configured by the :option:`-X int_max_str_digits <-X>` command line + flag or the :envvar:`PYTHONINTMAXSTRDIGITS` environment varable. + + Default: ``-1`` in Python mode. 4300 + (:data:`sys.int_info.default_max_str_digits`) in isolated mode. + + .. versionadded:: 3.12 + .. c:member:: int isolated If greater than ``0``, enable isolated mode: |