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-155273: Document PyConfig.lazy_imports by fedonman · Pull Request #155281 · python/cpython

Conversation

@fedonman

@fedonman fedonman commented Aug 6, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

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.

  • Issue: PyConfig.lazy_imports is missing from the C API configuration docs #155273

Sorry, something went wrong.

Uh oh!

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

All reactions
@fedonman
pythongh-155273: Document PyConfig.lazy_imports
10ec730
@fedonman
fedonman requested a review from FFY00 as a code owner August 6, 2026 14:00
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Aug 6, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Aug 6, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Aug 6, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Aug 6, 2026
PyConfig.lazy_imports is missing from the C API configuration docs #155273
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Aug 6, 2026
@read-the-docs-community

read-the-docs-community Bot commented Aug 6, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33944666 | 📁 Comparing 10ec730 against main (9cbb9e5)

  🔍 Preview build  

1 file changed
± c-api/init_config.html
All reactions

Sorry, something went wrong.

Uh oh!

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

aisk
aisk approved these changes Aug 6, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Aug 6, 2026
@fedonman

fedonman commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@FFY00 Hello, could you please review this?

All reactions

Sorry, something went wrong.

Uh oh!

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

@brittanyrey brittanyrey mentioned this pull request Oct 7, 2026
gh-142349: Update lazy imports C API and sys.flags documentation #158966
Merged
@fedonman

fedonman commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@ZeroIntensity, could you take a look when you have a moment? It adds the missing PyConfig.lazy_imports entry.

All reactions

Sorry, something went wrong.

Uh oh!

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

ZeroIntensity
ZeroIntensity approved these changes Nov 4, 2026
View reviewed changes

@ZeroIntensity ZeroIntensity 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
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Nov 4, 2026
@ZeroIntensity ZeroIntensity added the needs backport to 3.15 bugs and security fixes label Nov 4, 2026
@ZeroIntensity
ZeroIntensity merged commit be581b5 into python:main Nov 4, 2026
45 checks passed

Uh oh!

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

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Nov 4, 2026
@miss-islington-app

miss-islington-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

Thanks @fedonman for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 4, 2026
@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

GH-161297 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 4, 2026
ZeroIntensity pushed a commit that referenced this pull request Nov 4, 2026
@miss-islington @fedonman
[3.15] gh-155273: Document PyConfig.lazy_imports (GH-155281) (GH-16…
d01fec5
…1297)

(cherry picked from commit be581b5)

Co-authored-by: Vyron Vasileiadis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aisk aisk aisk approved these changes
@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes
@FFY00 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

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

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.

3 participants

@fedonman @aisk @ZeroIntensity
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 01402520 — 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.