Message414970
This still behaves similarly after the bpo-46642 fix:
>>> class V(TypeVar("T")): pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jelle/py/cpython/Lib/typing.py", line 906, in __init__
self.__constraints__ = tuple(_type_check(t, msg) for t in constraints)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jelle/py/cpython/Lib/typing.py", line 906, in <genexpr>
self.__constraints__ = tuple(_type_check(t, msg) for t in constraints)
^^^^^^^^^^^^^^^^^^^
File "/Users/jelle/py/cpython/Lib/typing.py", line 189, in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TypeVar(name, constraint, ...): constraints must be types. Got (~T,). |
|
Date |
User |
Action |
Args |
2022-03-12 03:39:46 | JelleZijlstra | set | recipients:
+ JelleZijlstra, serhiy.storchaka, sobolevn, kj, AlexWaygood, GBeauregard |
2022-03-12 03:39:46 | JelleZijlstra | set | messageid: <1647056386.34.0.478046522019.issue46642@roundup.psfhosted.org> |
2022-03-12 03:39:46 | JelleZijlstra | link | issue46642 messages |
2022-03-12 03:39:46 | JelleZijlstra | create | |
|