This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JelleZijlstra
Recipients AlexWaygood, GBeauregard, JelleZijlstra, kj, serhiy.storchaka, sobolevn
Date 2022-03-12.03:39:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647056386.34.0.478046522019.issue46642@roundup.psfhosted.org>
In-reply-to
Content
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,).
History
Date User Action Args
2022-03-12 03:39:46JelleZijlstrasetrecipients: + JelleZijlstra, serhiy.storchaka, sobolevn, kj, AlexWaygood, GBeauregard
2022-03-12 03:39:46JelleZijlstrasetmessageid: <1647056386.34.0.478046522019.issue46642@roundup.psfhosted.org>
2022-03-12 03:39:46JelleZijlstralinkissue46642 messages
2022-03-12 03:39:46JelleZijlstracreate