summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-04-11 10:25:45 (GMT)
committerGitHub <noreply@github.com>2023-04-11 10:25:45 (GMT)
commite071f00aaefae9eccf787d5c50396c26c8616483 (patch)
tree00c4903c298b9a6b55864cfa56a8e34b52936eaa /Doc/reference
parent21bea68e2e97369d808db7d053d4b51b3bc761b9 (diff)
downloadcpython-e071f00aaefae9eccf787d5c50396c26c8616483.zip
cpython-e071f00aaefae9eccf787d5c50396c26c8616483.tar.gz
cpython-e071f00aaefae9eccf787d5c50396c26c8616483.tar.bz2
gh-103373: `__mro_entries__` docs: improve cross references (#103398)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/datamodel.rst15
1 files changed, 10 insertions, 5 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index ed9ebab..9f91ade 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -2089,16 +2089,21 @@ Resolving MRO entries
.. method:: object.__mro_entries__(self, bases)
If a base that appears in a class definition is not an instance of
- :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
+ :class:`type`, then an :meth:`!__mro_entries__` method is searched on the base.
+ If an :meth:`!__mro_entries__` method is found, the base is substituted with the
+ result of a call to :meth:`!__mro_entries__` when creating the class.
+ 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