Skip to content

Conversation

@Yashp002
Copy link
Contributor

@Yashp002 Yashp002 commented Dec 3, 2025

Fixes #142197

Added missing from importlib.metadata import metadata import statement before the example code that uses metadata('wheel') in the overview section.

The documentation showed usage of the metadata() function without first importing it, causing a NameError when users tried to follow the example. This change ensures the example code is runnable as-is.


📚 Documentation preview 📚: https://cpython-previews--142208.org.readthedocs.build/

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Dec 3, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Dec 3, 2025
@Yashp002 Yashp002 changed the title Doc: Add missing import statement in importlib.metadata overview gh-142197: Doc: Add missing import statement in importlib.metadata overview Dec 3, 2025
Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

Please revert unrelated changes in different files.


You can get the :ref:`metadata for a distribution <metadata>`::

>>> list(metadata('wheel')) # doctest: +SKIP
Copy link
Member

Choose a reason for hiding this comment

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

Why are you changing the indentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

import.metadata overview missing import statement

2 participants