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.

classification
Title: Pegen can't parse some function type comments
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hauntsaninja, miss-islington
Priority: normal Keywords: patch

Created on 2020-05-04 04:21 by hauntsaninja, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19894 merged hauntsaninja, 2020-05-04 04:23
Messages (2)
msg368009 - (view) Author: Shantanu (hauntsaninja) * Date: 2020-05-04 04:21
Currently fails if we don't have any arguments before *args and **kwargs

```
~ λ python3.9
Python 3.9.0a6+ (heads/master:c95e691, May  3 2020, 19:57:46) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast; ast.parse("(*int) -> None", mode="func_type", type_comments=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/shantanu/.pyenv/versions/3.9-dev/lib/python3.9/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    (*int) -> None
     ^
SyntaxError: invalid syntax
```
msg368010 - (view) Author: miss-islington (miss-islington) Date: 2020-05-04 05:08
New changeset 603d3546264149f323edb7952b60075fb6bc4dc2 by Shantanu in branch 'master':
bpo-40493: fix function type comment parsing (GH-19894)
https://github.com/python/cpython/commit/603d3546264149f323edb7952b60075fb6bc4dc2
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84673
2020-05-04 05:09:59gvanrossumsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-05-04 05:08:21miss-islingtonsetnosy: + miss-islington
messages: + msg368010
2020-05-04 04:23:08hauntsaninjasetkeywords: + patch
stage: patch review
pull_requests: + pull_request19205
2020-05-04 04:21:40hauntsaninjacreate