Message398648
If Callable is nested, it works as expected:
>>> typing.List[C][int, str, float]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/home/serhiy/py/cpython/Lib/typing.py", line 1028, in __getitem__
_check_generic(self, params, len(self.__parameters__))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/serhiy/py/cpython/Lib/typing.py", line 231, in _check_generic
raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Too many parameters for typing.List[typing.Callable[~P, ~T]]; actual 3, expected 2
collections.abc.Callable raises an error too. |
|
| Date |
User |
Action |
Args |
| 2021-07-31 16:52:30 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, kj |
| 2021-07-31 16:52:30 | serhiy.storchaka | set | messageid: <[email protected]> |
| 2021-07-31 16:52:30 | serhiy.storchaka | link | issue44793 messages |
| 2021-07-31 16:52:30 | serhiy.storchaka | create | |
|