Open
Description
On both Python 3.11 and main
@ b57105a:
>>> import typing, collections.abc
>>> Ts = typing.TypeVarTuple("Ts")
>>> typing.Callable[[*Ts], None].__args__
(*Ts, <class 'NoneType'>)
>>> collections.abc.Callable[[*Ts], None].__args__
(*Ts, None)
According to this assertion in the test suite for typing.py
, the behaviour of typing.Callable
is correct here, whereas the behaviour of collections.abc.Callable
is incorrect:
cpython/Lib/test/test_typing.py
Lines 1290 to 1292 in b57105a
However, the test is currently only run with typing.Callable
, whereas it should be run with collections.abc.Callable
as well.
Cc. @mrahtz, who wrote this test. This may also be of interest to @sobolevn :)