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?

Comment on lines 93 to 94
You can get the :ref:`metadata for a distribution <metadata>`::

>>> from importlib.metadata import metadata # 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.

Please leave a blank line before >>>

@bedevere-app
Copy link

bedevere-app bot commented Dec 6, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Yashp002 and others added 2 commits December 9, 2025 21:55
Co-authored-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
@Yashp002
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented Dec 10, 2025

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from picnixz December 10, 2025 11:41
@Yashp002
Copy link
Contributor Author

@picnixz , just checking in, could you review my PR and let me know if there's anything more to fix?

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

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

import.metadata overview missing import statement

4 participants