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 corona10
Recipients Zoran Simic, benjamin.peterson, corona10
Date 2019-11-23.19:41:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574538118.67.0.251666994012.issue38871@roundup.psfhosted.org>
In-reply-to
Content
Dear core developers,

I 'd like to discuss fixing this issue.
IMHO, There are 2 options to fix this issue.

1. Add parenthesize when creating ListComp.
The change will be as follow:
             new = ListComp(results.get("fp").clone(),
                            results.get("fp").clone(),
                            results.get("it").clone(),
-                           results.get("xp").clone())
+                           parenthesize(results.get("xp").clone()))

But generated codes are not pretty.

2. Transform the lambda function as same as a normal function.
The only needed is removing lambda specific logics on fixer.

The generated code will be like this in this case.
x = filter(lambda x: True if x > 2 else False, data)
x = list(filter(lambda x: True if x > 2 else False, data))

Personally, I prefer the 2nd option because it's more clear.
If the proposal is accepted, I 'd like to fix this issue. 

If there are any ideas, please let me know.
Thank you always!
History
Date User Action Args
2019-11-23 19:41:58corona10setrecipients: + corona10, benjamin.peterson, Zoran Simic
2019-11-23 19:41:58corona10setmessageid: <1574538118.67.0.251666994012.issue38871@roundup.psfhosted.org>
2019-11-23 19:41:58corona10linkissue38871 messages
2019-11-23 19:41:58corona10create