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 serhiy.storchaka
Recipients AlexWaygood, GBeauregard, Gobot1234, JelleZijlstra, gvanrossum, kj, levkivskyi, serhiy.storchaka, sobolevn
Date 2022-02-06.19:39:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644176393.85.0.657469880386.issue46644@roundup.psfhosted.org>
In-reply-to
Content
No, List[42] is not currently accepted.

>>> List[42]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/typing.py", line 318, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/typing.py", line 1127, in __getitem__
    params = tuple(_type_check(p, msg) for p in params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/typing.py", line 1127, in <genexpr>
    params = tuple(_type_check(p, msg) for p in params)
                   ^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/typing.py", line 184, in _type_check
    raise TypeError(f"{msg} Got {arg!r:.100}.")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Parameters to generic types must be types. Got 42.
History
Date User Action Args
2022-02-06 19:39:53serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, levkivskyi, JelleZijlstra, sobolevn, Gobot1234, kj, AlexWaygood, GBeauregard
2022-02-06 19:39:53serhiy.storchakasetmessageid: <1644176393.85.0.657469880386.issue46644@roundup.psfhosted.org>
2022-02-06 19:39:53serhiy.storchakalinkissue46644 messages
2022-02-06 19:39:53serhiy.storchakacreate