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-142349: Document `LazyImportType.resolve()` method by Viicos · Pull Request #156936 · python/cpython

Conversation

@Viicos

@Viicos Viicos commented Sep 4, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

resolve() is referenced several times in PEP 810, but not documented. I believe it would make sense to explicitly document it.

See also #156924.

  • Issue: Implement PEP 810 – Explicit lazy imports #142349

Sorry, something went wrong.

Uh oh!

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

All reactions
@Viicos
pythongh-142349: Document LazyImportType.resolve() method
1ddd01d
@bedevere-app bedevere-app Bot mentioned this pull request Sep 4, 2026
Implement PEP 810 – Explicit lazy imports #142349
Closed
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Sep 4, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Sep 4, 2026
@bedevere-app bedevere-app Bot added the awaiting review label Sep 4, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Sep 4, 2026
@read-the-docs-community

read-the-docs-community Bot commented Sep 4, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34491218 | 📁 Comparing dcd84d0 against main (7d71b3e)

  🔍 Preview build  

19 files changed · ± 19 modified

± Modified

  • c-api/marshal.html
  • c-api/module.html
  • c-api/type.html
  • howto/logging-cookbook.html
  • howto/mro.html
  • library/argparse.html
  • library/curses.html
  • library/difflib.html
  • library/logging.config.html
  • library/math.html
  • and 9 more...
All reactions

Sorry, something went wrong.

Uh oh!

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

@johnslavik

This comment was marked as resolved.

Sign in to view
johnslavik
johnslavik reviewed Sep 7, 2026
View reviewed changes

@johnslavik johnslavik 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.

Hmmm, https://docs.python.org/3.16/reference/simple_stmts.html#lazy doesn't know about types.LazyImportType. Additionally, none of the classes in types have method documentations.

Maybe the right place for this documentation is in https://docs.python.org/3.16/reference/simple_stmts.html#lazy?

Sorry, something went wrong.

Uh oh!

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

All reactions
@johnslavik

johnslavik commented Sep 7, 2026

Copy link
Copy Markdown
Member

And https://docs.python.org/3.16/library/types.html#types.LazyImportType doesn't know about https://docs.python.org/3.16/reference/simple_stmts.html#lazy. These guys should talk to each other.

All reactions

Sorry, something went wrong.

Uh oh!

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

@johnslavik

johnslavik commented Sep 7, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Actually, this belongs to built-in types. Generator (that isn't a builtin name) interface is documented there too.

@Viicos can we move this to built-in types?

All reactions

Sorry, something went wrong.

Uh oh!

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

@JelleZijlstra

JelleZijlstra commented Sep 8, 2026

Copy link
Copy Markdown
Member

I think documenting this in types.rst makes more sense; MappingProxyType is also documented there with some methods.

johnslavik reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@Viicos

Viicos commented Sep 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

I indeed took MappingProxyType as a precedent when documenting the method. However, it is the only one currently doing so. Maybe we should move the method definitions of MappingProxyType to https://docs.python.org/3/library/stdtypes.html, and ensure this is done for other types (such as lazy imports) in the future? As mentioned, this is already the case for generator-iterators, which has types.GeneratorType without any method documented.

I also know the stdlib page is huge and there are plans to split it, so not sure what should be done today.

johnslavik reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@johnslavik

johnslavik commented Sep 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

@encukou, what would you recommend?

All reactions

Sorry, something went wrong.

Uh oh!

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

encukou
encukou approved these changes Sep 8, 2026
View reviewed changes

@encukou encukou left a comment •
edited
Loading

Uh oh!

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

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.

IMO, eventually this should be in a new builtins section, but, that's not in place now :)
Any of the proposed locations fine; stick with the current version.

And https://docs.python.org/3.16/library/types.html#types.LazyImportType doesn't know about https://docs.python.org/3.16/reference/simple_stmts.html#lazy

The bigger issue is that reference/simple_stmts has a stub that refers to PEP 810 for the “full specification”, while PEP 810 points right back for the “canonical documentation”. The full spec should move to the docs. But that's not for this PR to solve.

Sorry, something went wrong.

Uh oh!

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

johnslavik reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Sep 8, 2026
@johnslavik

johnslavik commented Sep 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The full spec should move to the docs. But that's not for this PR to solve.

I worked on this a while ago!

All reactions

Sorry, something went wrong.

Uh oh!

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

johnslavik
johnslavik approved these changes Sep 8, 2026
View reviewed changes
encukou
encukou reviewed Sep 8, 2026
View reviewed changes
Comment thread Doc/library/types.rst Resolved

Uh oh!

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

@encukou @Viicos
Apply suggestion: mention the return value
dcd84d0
Co-authored-by: Victorien <[email protected]>
@encukou
encukou enabled auto-merge (squash) September 10, 2026 13:24
@encukou
encukou merged commit 4616116 into python:main Sep 10, 2026
30 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 10, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Sep 10, 2026
@encukou encukou added the needs backport to 3.15 bugs and security fixes label Sep 11, 2026
@miss-islington-app

miss-islington-app Bot commented Sep 11, 2026

Copy link
Copy Markdown

Thanks @Viicos for the PR, and @encukou 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 commented Sep 11, 2026

Copy link
Copy Markdown

GH-157296 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 Sep 11, 2026
hugovk pushed a commit that referenced this pull request Sep 11, 2026
@miss-islington @Viicos
[3.15] gh-142349: Document LazyImportType.resolve() method (GH-156936…
8bcee87
…) (#157296)

Co-authored-by: Victorien <[email protected]>
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@Viicos @clin1234
pythongh-142349: Document LazyImportType.resolve() method (pythonGH…
a8b6d91
…-156936)
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
@Viicos @johnslavik
pythongh-142349: Document LazyImportType.resolve() method (pythonGH…
d56c822
…-156936)
Kronuz pushed a commit to Kronuz/cpython that referenced this pull request Oct 5, 2026
@miss-islington @Viicos @Kronuz
[3.15] pythongh-142349: Document LazyImportType.resolve() method (p…
19867ad
…ythonGH-156936) (python#157296)

Co-authored-by: Victorien <[email protected]>
(cherry picked from commit 8bcee87)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou approved these changes
@johnslavik johnslavik johnslavik approved these changes

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.

4 participants

@Viicos @johnslavik @JelleZijlstra @encukou
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.