GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-96512: Move int_max_str_digits setting to PyConfig by gpshead · Pull Request #96944 · python/cpython

Conversation

@gpshead

@gpshead gpshead commented Sep 20, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

  • Issue: main branch code cleanups for int_max_str_digits non-backportable TODOs #96512

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gpshead added 2 commits September 20, 2022 00:38
@gpshead
pythongh-96512: Move int_max_str_digits setting to PyConfig
cf20758
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.
@gpshead
Add a test_capi test to verify unique configs.
86c4b6e
Also demonstrates that subinterpreters maintain their own limit
as a feature.
@gpshead
gpshead requested review from mdickinson and vstinner September 20, 2022 01:02
@gpshead gpshead self-assigned this Sep 20, 2022
@bedevere-bot bedevere-bot added the awaiting core review label Sep 20, 2022
@gpshead

gpshead commented Sep 20, 2022

Copy link
Copy Markdown
Member Author

This pulls out the important config change from #96568, addressing its comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead added 2 commits September 20, 2022 01:05
@gpshead
NEWS entry.
26dfda5
@gpshead
Merge branch 'main' into cleanup/int-dos-use-pyconfig
34feabc
@gpshead gpshead added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-C-API labels Sep 20, 2022
gpshead
gpshead commented Sep 20, 2022
View reviewed changes
Comment thread Python/sysmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gpshead
gpshead marked this pull request as ready for review September 20, 2022 01:25
vstinner
vstinner reviewed Sep 21, 2022
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like this change overall :-) Here is a first review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Python/sysmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/initconfig.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/initconfig.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/sysmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Programs/_testembed.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/init_config.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/init_config.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_capi.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_capi.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

gpshead added 3 commits September 21, 2022 16:51
@gpshead
Split and move the subinterpreter isolation tests
21a21ed
@gpshead
Address review comments.
8b4561d
@gpshead
Don't expose -1 in sys.flags.
7247e78
@mdickinson
mdickinson removed their request for review September 25, 2022 09:39
@mdickinson

mdickinson commented Sep 25, 2022

Copy link
Copy Markdown
Member

Removing myself from review; Victor's got this. :-)

gpshead reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gpshead
Merge branch 'main' into cleanup/int-dos-use-pyconfig
d8f1d8e
@gpshead

gpshead commented Oct 1, 2022

Copy link
Copy Markdown
Member Author

I think this is ready, please take another look @vstinner

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner approved these changes Oct 3, 2022
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_capi.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Oct 3, 2022
@gpshead
clarify the purpose of the test_capi test via comment
1a5935d
@gpshead
gpshead merged commit b0f89cb into python:main Oct 3, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Oct 3, 2022
@gpshead
gpshead deleted the cleanup/int-dos-use-pyconfig branch October 3, 2022 20:56
carljm added a commit to carljm/cpython that referenced this pull request Oct 3, 2022
@carljm
Merge branch 'main' into dictwatch
e83abac
* main: (2069 commits)
  pythongh-96512: Move int_max_str_digits setting to PyConfig (python#96944)
  pythongh-94808: Coverage: Check picklablability of calliter (python#95923)
  pythongh-94808: Add test coverage for PyObject_HasAttrString (python#96627)
  pythongh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (python#97765)
  Fix typos in `bltinmodule.c`. (pythonGH-97766)
  pythongh-94808: `_PyLineTable_StartsLine` was not used (pythonGH-96609)
  pythongh-97681: Remove Tools/demo/ directory (python#97682)
  Fix typo in unittest docs (python#97742)
  pythongh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE converter (pythonGH-97729)
  pythongh-95913: Fix PEP number in PEP 678 What's New ref label (python#97739)
  pythongh-95913: Copyedit/improve New Modules What's New section (python#97721)
  pythongh-97740: Fix bang in Sphinx C domain ref target syntax (python#97741)
  pythongh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 (python#96890)
  pythongh-97706: multiprocessing tests: Delete unused variable `rand` (python#97707)
  pythonGH-85447: Clarify docs about awaiting future multiple times (python#97738)
  [docs] Update logging cookbook with recipe for using a logger like an output… (pythonGH-97730)
  pythongh-97607: Fix content parsing in the impl-detail reST directive (python#97652)
  pythongh-95975: Move except/*/finally ref labels to more precise locations (python#95976)
  pythongh-97591: In `Exception.__setstate__()` acquire strong references before calling `tp_hash` slot (python#97700)
  pythongh-95588: Drop the safety claim from `ast.literal_eval` docs. (python#95919)
  ...
@ericsnowcurrently ericsnowcurrently mentioned this pull request Oct 18, 2022
PyInterpreterState.config.int_max_str_digits Should Not Be Modified #98417
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ambv ambv ambv left review comments
@vstinner vstinner vstinner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gpshead gpshead

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-C-API type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@gpshead @mdickinson @ambv @vstinner @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.