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 gvanrossum, kj, serhiy.storchaka, yselivanov
Date 2021-10-28.20:38:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
In-reply-to
Content
resolve_bases() returns incorrect result:

>>> import types
>>> types.resolve_bases((list[int],))
(list[int],)

Expected (list,).

new_class() fails:

>>> types.new_class('L', (list[int],), {})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/types.py", line 77, in new_class
    return meta(name, resolved_bases, ns, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GenericAlias expected 2 arguments, got 3

Both work well with typing.List[int].
History
Date User Action Args
2021-10-28 20:38:27serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, yselivanov, kj
2021-10-28 20:38:27serhiy.storchakasetmessageid: <1635453507.8.0.842225708276.issue45664@roundup.psfhosted.org>
2021-10-28 20:38:27serhiy.storchakalinkissue45664 messages
2021-10-28 20:38:27serhiy.storchakacreate