Skip to content
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
Update some documentation
  • Loading branch information
warsaw committed Oct 4, 2022
commit fc50fe143ac56f2658187a8e765cd0584aaeaa42
8 changes: 6 additions & 2 deletions Doc/reference/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,11 @@ the module.
for introspection, but can be used for additional loader-specific
functionality, for example getting data associated with a loader.

.. 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
raised.

.. attribute:: __package__

The module's ``__package__`` attribute must be set. Its value must
Expand All @@ -563,8 +568,7 @@ the module.
details.

This attribute is used instead of ``__name__`` to calculate explicit
relative imports for main modules, as defined in :pep:`366`. It is
expected to have the same value as ``__spec__.parent``.
relative imports for main modules, as defined in :pep:`366`.

.. versionchanged:: 3.6
The value of ``__package__`` is expected to be the same as
Expand Down