Uh oh!
There was an error while loading. Please reload this page.
gh-155273: Document PyConfig.lazy_imports - #155281
Open
fedonman wants to merge 1 commit into
Open
Conversation
Documentation build overview
|
aisk
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
lazy_importsis a PUBLIC entry inPYCONFIG_SPEC(Python/initconfig.c:127) and a member ofPyConfig(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 inDoc/c-api/import.rst,Doc/using/cmdline.rstand 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:-1is the default and respects thelazykeyword,1makes every import lazy,0is 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, nosphinx-lintand nopip. Instead I checked that every target used already resolves in the tree (_lazy-imports:inDoc/reference/simple_stmts.rst,.. envvar:: PYTHON_LAZY_IMPORTSinDoc/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.
PyConfig.lazy_importsis missing from the C API configuration docs #155273