8000 gh-86298: Ensure that __loader__ and __spec__.loader agree in warnings.warn_explicit() by warsaw · Pull Request #97803 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-86298: Ensure that __loader__ and __spec__.loader agree in warnings.warn_explicit() #97803

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

Merged
merged 17 commits into from
Oct 7, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into issue-86298
  • Loading branch information
warsaw committed Oct 6, 2022
commit 460236660c802c5597632a367ecdc31087e91164
6 changes: 6 additions & 0 deletions Doc/reference/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,9 @@ listed below.
for introspection, but can be used for additional loader-specific
functionality, for example getting data associated with a loader.

It is **strongly** recommended that you rely on :attr:`__spec__`
instead instead of this attribute.

.. versionchanged:: 3.12
The value of ``__loader__`` is expected to be the same as
``__spec__.loader``. If they are not, an :exc:`ImportWarning` will be
Expand All @@ -573,6 +576,9 @@ listed below.
This attribute is used instead of ``__name__`` to calculate explicit
relative imports for main modules, as defined in :pep:`366`.

It is **strongly** recommended that you rely on :attr:`__spec__`
instead instead of this attribute.

.. versionchanged:: 3.6
The value of ``__package__`` is expected to be the same as
``__spec__.parent``.
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0