Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e071f00

Browse filesBrowse files
pythongh-103373: __mro_entries__ docs: improve cross references (python#103398)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
1 parent 21bea68 commit e071f00
Copy full SHA for e071f00

File tree

2 files changed

+12
-7
lines changed
Filter options

2 files changed

+12
-7
lines changed

‎Doc/library/types.rst

Copy file name to clipboardExpand all lines: Doc/library/types.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ Dynamic Type Creation
7575

7676
This function looks for items in *bases* that are not instances of
7777
:class:`type`, and returns a tuple where each such object that has
78-
an ``__mro_entries__`` method is replaced with an unpacked result of
78+
an :meth:`~object.__mro_entries__` method is replaced with an unpacked result of
7979
calling this method. If a *bases* item is an instance of :class:`type`,
80-
or it doesn't have an ``__mro_entries__`` method, then it is included in
80+
or it doesn't have an :meth:`!__mro_entries__` method, then it is included in
8181
the return tuple unchanged.
8282

8383
.. versionadded:: 3.7

‎Doc/reference/datamodel.rst

Copy file name to clipboardExpand all lines: Doc/reference/datamodel.rst
+10-5Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,16 +2089,21 @@ Resolving MRO entries
20892089
.. method:: object.__mro_entries__(self, bases)
20902090

20912091
If a base that appears in a class definition is not an instance of
2092-
:class:`type`, then an ``__mro_entries__`` method is searched on the base.
2093-
If an ``__mro_entries__`` method is found, the base is substituted with the
2094-
result of a call to ``__mro_entries__`` when creating the class.
2095-
The method is called with the original bases tuple, and must return a tuple
2092+
:class:`type`, then an :meth:`!__mro_entries__` method is searched on the base.
2093+
If an :meth:`!__mro_entries__` method is found, the base is substituted with the
2094+
result of a call to :meth:`!__mro_entries__` when creating the class.
2095+
The method is called with the original bases tuple
2096+
passed to the *bases* parameter, and must return a tuple
20962097
of classes that will be used instead of the base. The returned tuple may be
20972098
empty: in these cases, the original base is ignored.
20982099

20992100
.. seealso::
21002101

2101-
:pep:`560` - Core support for typing module and generic types
2102+
:func:`types.resolve_bases`
2103+
Dynamically resolve bases that are not instances of :class:`type`.
2104+
2105+
:pep:`560`
2106+
Core support for typing module and generic types.
21022107

21032108

21042109
Determining the appropriate metaclass

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.