FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-142349: Document `LazyImportType.resolve()` method by Viicos · Pull Request #156936 · python/cpython · GitHub

Repository navigation

gh-142349: Document LazyImportType.resolve() method - #156936

Merged
encukou merged 2 commits into
python:mainfrom
Viicos:vp/lazy-resolve
Sep 10, 2026
Merged

encukou merged 2 commits into
python:mainfrom
Viicos:vp/lazy-resolve

Conversation

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

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.

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

Copy link
Copy Markdown

This comment was marked as resolved.

johnslavik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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?

Copy link
Copy Markdown
Member

johnslavik commented Sep 7, 2026 •
edited
Loading

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?

Copy link
Copy Markdown
Member

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

Viicos commented Sep 8, 2026 •
edited
Loading

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 commented Sep 8, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

@encukou, what would you recommend?

encukou left a comment •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

johnslavik commented Sep 8, 2026 •
edited
Loading

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!

Comment thread Doc/library/types.rst Outdated
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
encukou enabled auto-merge (squash) September 10, 2026 13:24
encukou merged commit 4616116 into python:main Sep 10, 2026
30 checks passed
github-project-automation Bot moved this from Todo to Done in Docs PRs Sep 10, 2026
encukou added the needs backport to 3.15 bugs and security fixes label 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.
🐍🍒⛏🤖

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.

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
…) (#157296)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
Kronuz pushed a commit to Kronuz/cpython that referenced this pull request Oct 5, 2026
…ythonGH-156936) (python#157296)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
(cherry picked from commit 8bcee87)
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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL