Skip to content

Commit ca01236

Browse files
bpo-32996: Documentation fix-up. (GH-16646)
PR GH-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. (cherry picked from commit d47f0dd) Co-authored-by: M. Eric Irrgang <mei2n@virginia.edu>
1 parent d27a9b1 commit ca01236

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
@@ -306,9 +306,10 @@ User defined generic type aliases are also supported. Examples::
306306
def inproduct(v: Vec[T]) -> T: # Same as Iterable[Tuple[T, T]]
307307
return sum(x*y for x, y in v)
308308

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

0 commit comments

Comments
 (0)