GeezerVison is showing github.com — gh-155273: Document PyConfig.lazy_imports by fedonman · Pull Request #155281 · python/cpython
Conversation
fedonman
commented
Aug 6, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
lazy_imports is a PUBLIC entry in PYCONFIG_SPEC (Python/initconfig.c:127) and a member of PyConfig (Include/cpython/initconfig.h:194), but it was the only one of the 25 PUBLIC options with no entry in this file. PEP 810 documented the feature in Doc/c-api/import.rst, Doc/using/cmdline.rst and the whatsnew, and missed this one.
This adds the row to the Configuration Options table and the c:member: block, both in their alphabetical place, and documents the tri-state: -1 is the default and respects the lazy keyword, 1 makes every import lazy, 0 is rejected (Python/initconfig.c:1092, and the default is set at :1206).
I could not build the docs here: this environment has no sphinx-build, no sphinx-lint and no pip. Instead I checked that every target used already resolves in the tree (_lazy-imports: in Doc/reference/simple_stmts.rst, .. envvar:: PYTHON_LAZY_IMPORTS in Doc/using/cmdline.rst), and copied the :option:-X ... <-X>`` form and the row layout from the neighbouring entries. The readthedocs preview build on this PR is the real check.
3.15 has the same gap, so this looks like a backport candidate.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@FFY00 Hello, could you please review this?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@ZeroIntensity, could you take a look when you have a moment? It adds the missing PyConfig.lazy_imports entry.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @fedonman for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
aisk
aisk approved these changes
FFY00
Awaiting requested review from FFY00
FFY00 is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|