summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-10-10 11:17:05 (GMT)
committerGitHub <noreply@github.com>2019-10-10 11:17:05 (GMT)
commitca012360b103f2ab1acfa506aed032b0ed9b105c (patch)
treec5516f2d8e28467edbaf0517fd47bdff2d353a28
parentd27a9b1695a1b46c81b3a83a7a35034791265d89 (diff)
downloadcpython-ca012360b103f2ab1acfa506aed032b0ed9b105c.zip
cpython-ca012360b103f2ab1acfa506aed032b0ed9b105c.tar.gz
cpython-ca012360b103f2ab1acfa506aed032b0ed9b105c.tar.bz2
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 d47f0dd2e85ce032aebfedbde18cdb2e728fa79f) Co-authored-by: M. Eric Irrgang <mei2n@virginia.edu>
-rw-r--r--Doc/library/typing.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 627c1f7..b42f33c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -306,9 +306,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.