Skip to content

gh-103373: __mro_entries__ docs: improve cross references #103398

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 3 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Dynamic Type Creation

This function looks for items in *bases* that are not instances of
:class:`type`, and returns a tuple where each such object that has
an ``__mro_entries__`` method is replaced with an unpacked result of
an :meth:`~object.__mro_entries__` method is replaced with an unpacked result of
calling this method. If a *bases* item is an instance of :class:`type`,
or it doesn't have an ``__mro_entries__`` method, then it is included in
the return tuple unchanged.
Expand Down
9 changes: 7 additions & 2 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2092,13 +2092,18 @@ Resolving MRO entries
:class:`type`, then an ``__mro_entries__`` method is searched on the base.
If an ``__mro_entries__`` method is found, the base is substituted with the
result of a call to ``__mro_entries__`` when creating the class.
The method is called with the original bases tuple, and must return a tuple
The method is called with the original bases tuple
passed to the *bases* parameter, and must return a tuple
of classes that will be used instead of the base. The returned tuple may be
empty: in these cases, the original base is ignored.

.. seealso::

:pep:`560` - Core support for typing module and generic types
:func:`types.resolve_bases`
Dynamically resolve bases that are not instances of :class:`type`.

:pep:`560`
Core support for typing module and generic types


Determining the appropriate metaclass
Expand Down