Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-30535: Explicitly note that sys.meta_path is not empty #13300

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,8 @@ always available.

A list of :term:`meta path finder` objects that have their
:meth:`~importlib.abc.MetaPathFinder.find_spec` methods called to see if one
of the objects can find the module to be imported. The
of the objects can find the module to be imported. By default, it holds entries
to handle the standard kinds of modules (.py files, extension modules...). The
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
to handle the standard kinds of modules (.py files, extension modules...). The
that implement Python's default import semantics. The

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brettcannon Do you think we should add examples after that. Like:

that implement Python's default import semantics. (BuiltinImporter, FrozenImporter, and PathFinder)

Copy link
Member

Choose a reason for hiding this comment

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

No, as that's too easy of a thing to forget to update. Plus there's no guarantee that every interpreter will set up sys.meta_path the same.

:meth:`~importlib.abc.MetaPathFinder.find_spec` method is called with at
least the absolute name of the module being imported. If the module to be
imported is contained in a package, then the parent package's :attr:`__path__`
Expand Down