File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,9 @@ Dynamic Type Creation
75
75
76
76
This function looks for items in *bases * that are not instances of
77
77
: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
79
79
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
81
81
the return tuple unchanged.
82
82
83
83
.. versionadded :: 3.7
Original file line number Diff line number Diff line change @@ -2089,16 +2089,21 @@ Resolving MRO entries
2089
2089
.. method :: object.__mro_entries__(self, bases)
2090
2090
2091
2091
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
2096
2097
of classes that will be used instead of the base. The returned tuple may be
2097
2098
empty: in these cases, the original base is ignored.
2098
2099
2099
2100
.. seealso ::
2100
2101
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.
2102
2107
2103
2108
2104
2109
Determining the appropriate metaclass
You can’t perform that action at this time.
0 commit comments