New submission from Batuhan Taskaya <isidenti...@gmail.com>:

>>> from __future__ import annotations
>>> a: Type[int, str]
>>> b: Type[(int, str, *types)]
>>> __annotations__
{'a': 'Type[int, str]', 'b': 'Type[int, str, *types]'}
>>> ast.parse(__annotations__["b"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/isidentical/cpython/master/Lib/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    Type[int, str, *types]
                   ^
SyntaxError: invalid syntax

----------
messages: 369140
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: Wrong generated annotation on subscripting

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40663>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to