Skip to content

gh-98417: Stop modifying PyConfig in sys.set_int_max_str_digits()#152869

Draft
gpshead wants to merge 1 commit into
python:mainfrom
gpshead:claude/cpython-98417-fix-6vqutb
Draft

gh-98417: Stop modifying PyConfig in sys.set_int_max_str_digits()#152869
gpshead wants to merge 1 commit into
python:mainfrom
gpshead:claude/cpython-98417-fix-6vqutb

Conversation

@gpshead

@gpshead gpshead commented Jul 2, 2026

Copy link
Copy Markdown
Member

PyConfig is an input to interpreter initialization; the copy stored on PyInterpreterState records how the interpreter was initialized. The runtime int<->str digit limit already lives in
PyInterpreterState.long_state.max_str_digits and that is what all readers use, so drop the write-back into
interp->config.int_max_str_digits from _PySys_SetIntMaxStrDigits().

As a consequence, interpreters created after a runtime limit change now start from the initially-configured limit instead of inheriting the current runtime value.


it's basically a one line change... the question is, is this what we want? we'll resolve that on the issue.

@python-cla-bot

python-cla-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

PyConfig is an input to interpreter initialization; the copy stored on
PyInterpreterState records how the interpreter was initialized.  The
runtime int<->str digit limit already lives in
PyInterpreterState.long_state.max_str_digits and that is what all
readers use, so drop the write-back into
interp->config.int_max_str_digits from _PySys_SetIntMaxStrDigits().

As a consequence, interpreters created after a runtime limit change now
start from the initially-configured limit instead of inheriting the
current runtime value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gpshead gpshead force-pushed the claude/cpython-98417-fix-6vqutb branch from 7115bfd to 9675274 Compare July 2, 2026 08:03
@gpshead gpshead requested a review from zooba July 2, 2026 08:05
@zooba

zooba commented Jul 2, 2026

Copy link
Copy Markdown
Member

I assume it won't change much on its way out of draft, but provided the change is just removing that line then I'm not going to have any concerns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants