Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 716 Bytes

2020-11-20-00-57-47.bpo-42195.HeqcpS.rst

File metadata and controls

11 lines (10 loc) · 716 Bytes

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 types no longer validate their argtypes, in Callable[[argtypes], resulttype] to prepare for PEP 612. Patch by Ken Jin.