summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/Core and Builtins/2020-11-20-00-57-47.bpo-42195.HeqcpS.rst
blob: 87e8c0e89b3b8f73ac71d0293cb0ffbecce7766a (plain)
1
2
3
4
5
6
7
8
9
10
The ``__args__`` of the parameterized generics for :data:`typing.Callable`
and :class:`collections.abc.Callable` are now consistent.  The ``__args__``
for :class:`collections.abc.Callable` are now flattened while
:data:`typing.Callable`'s have not changed.  To allow this change,
:class:`types.GenericAlias` can now be subclassed and
``collections.abc.Callable``'s ``__class_getitem__`` will now return a subclass
of ``types.GenericAlias``.  Tests for typing were also updated to not subclass
things like ``Callable[..., T]`` as that is not a valid base class.  Finally,
both ``Callable``\ s no longer validate their ``argtypes``, in
``Callable[[argtypes], resulttype]`` to prepare for :pep:`612`.  Patch by Ken Jin.