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 @@ -2088,16 +2088,21 @@ Resolving MRO entries
2088
2088
.. method :: object.__mro_entries__(self, bases)
2089
2089
2090
2090
If a base that appears in a class definition is not an instance of
2091
- :class: `type `, then an ``__mro_entries__ `` method is searched on the base.
2092
- If an ``__mro_entries__ `` method is found, the base is substituted with the
2093
- result of a call to ``__mro_entries__ `` when creating the class.
2094
- The method is called with the original bases tuple, and must return a tuple
2091
+ :class: `type `, then an :meth: `!__mro_entries__ ` method is searched on the base.
2092
+ If an :meth: `!__mro_entries__ ` method is found, the base is substituted with the
2093
+ result of a call to :meth: `!__mro_entries__ ` when creating the class.
2094
+ The method is called with the original bases tuple
2095
+ passed to the *bases * parameter, and must return a tuple
2095
2096
of classes that will be used instead of the base. The returned tuple may be
2096
2097
empty: in these cases, the original base is ignored.
2097
2098
2098
2099
.. seealso ::
2099
2100
2100
- :pep: `560 ` - Core support for typing module and generic types
2101
+ :func: `types.resolve_bases `
2102
+ Dynamically resolve bases that are not instances of :class: `type `.
2103
+
2104
+ :pep: `560 `
2105
+ Core support for typing module and generic types.
2101
2106
2102
2107
2103
2108
Determining the appropriate metaclass
You can’t perform that action at this time.
0 commit comments