]> granicus.if.org Git - python/commitdiff
bpo-32996: Documentation fix-up. (GH-16646)
authorM. Eric Irrgang <mei2n@virginia.edu>
Thu, 10 Oct 2019 11:11:33 +0000 (14:11 +0300)
committerIvan Levkivskyi <levkivskyi@gmail.com>
Thu, 10 Oct 2019 11:11:33 +0000 (12:11 +0100)
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.

Doc/library/typing.rst

index f4d1b2404328dd131f5b7de27a89837bd0847437..642f8c653eeb5d923dc09b4670947cb06fbbbc2c 100644 (file)
@@ -307,9 +307,10 @@ User defined generic type aliases are also supported. Examples::
    def inproduct(v: Vec[T]) -> T: # Same as Iterable[Tuple[T, T]]
        return sum(x*y for x, y in v)
 
-The metaclass used by :class:`Generic` is a subclass of :class:`abc.ABCMeta`.
-A generic class can be an ABC by including abstract methods or properties,
-and generic classes can also have ABCs as base classes without a metaclass
+.. versionchanged:: 3.7
+    :class:`Generic` no longer has a custom metaclass.
+
+A user-defined generic class can have ABCs as base classes without a metaclass
 conflict. Generic metaclasses are not supported. The outcome of parameterizing
 generics is cached, and most types in the typing module are hashable and
 comparable for equality.