diff options
author | M. Eric Irrgang <mei2n@virginia.edu> | 2019-10-10 11:11:33 (GMT) |
---|---|---|
committer | Ivan Levkivskyi <levkivskyi@gmail.com> | 2019-10-10 11:11:33 (GMT) |
commit | d47f0dd2e85ce032aebfedbde18cdb2e728fa79f (patch) | |
tree | b891325f6c0fca2127bb9646be2b48bc4210b312 /Doc/library/typing.rst | |
parent | a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b (diff) | |
download | cpython-d47f0dd2e85ce032aebfedbde18cdb2e728fa79f.zip cpython-d47f0dd2e85ce032aebfedbde18cdb2e728fa79f.tar.gz cpython-d47f0dd2e85ce032aebfedbde18cdb2e728fa79f.tar.bz2 |
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.
Diffstat (limited to 'Doc/library/typing.rst')
-rw-r--r-- | Doc/library/typing.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index f4d1b24..642f8c6 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -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. |