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: ast.unparse: dont use redundant space separator for lambdas with no parameters
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: BTaskaya Nosy List: BTaskaya, terry.reedy
Priority: normal Keywords: patch

Created on 2021-05-08 23:38 by BTaskaya, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26000 merged BTaskaya, 2021-05-09 00:28
Messages (2)
msg393288 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2021-05-08 23:38
Previously:

>>> import ast
>>> ast.unparse(ast.parse("lambda: 'hey!'"))
"lambda : 'hey!'"

Expected:

>>> import ast
>>> ast.unparse(ast.parse("lambda: 'hey!'"))
"lambda: 'hey!'"
msg393699 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-05-14 22:35
Agreed. unparse is already correct if there is a parameter.
>>> ast.unparse(ast.parse("lambda x: 'hey!'"))
"lambda x: 'hey!'"
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88247
2021-05-15 13:00:23BTaskayasetstatus: open -> closed
stage: patch review -> resolved
2021-05-14 22:35:15terry.reedysetnosy: + terry.reedy
messages: + msg393699
2021-05-09 00:28:49BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request24653
2021-05-08 23:38:15BTaskayacreate