Skip to content

Commit d47f0dd

Browse files
eirrgangilevkivskyi
authored andcommitted
bpo-32996: Documentation fix-up. (GH-16646)
PR #4906 changed the typing.Generic class hierarchy, leaving an outdated comment in the library reference. User-defined Generic ABCs now must get a abc.ABCMeta metaclass from something other than typing.Generic inheritance.
1 parent a05fcd3 commit d47f0dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/library/typing.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,10 @@ User defined generic type aliases are also supported. Examples::
307307
def inproduct(v: Vec[T]) -> T: # Same as Iterable[Tuple[T, T]]
308308
return sum(x*y for x, y in v)
309309

310-
The metaclass used by :class:`Generic` is a subclass of :class:`abc.ABCMeta`.
311-
A generic class can be an ABC by including abstract methods or properties,
312-
and generic classes can also have ABCs as base classes without a metaclass
310+
.. versionchanged:: 3.7
311+
:class:`Generic` no longer has a custom metaclass.
312+
313+
A user-defined generic class can have ABCs as base classes without a metaclass
313314
conflict. Generic metaclasses are not supported. The outcome of parameterizing
314315
generics is cached, and most types in the typing module are hashable and
315316
comparable for equality.

0 commit comments

Comments
 (0)