[New-bugs-announce] [issue40663] Wrong generated annotation on subscripting

Batuhan Taskaya report at bugs.python.org
Sun May 17 13:36:39 EDT 2020


New submission from Batuhan Taskaya <isidentical at 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 <report at bugs.python.org>
<https://bugs.python.org/issue40663>
_______________________________________


More information about the New-bugs-announce mailing list