Message322768
Sorry, I missed that you didn't receive a notification about creating of the reverting PR. I should announce this explicitly.
2to3 handles the old syntax, but a comma after a generator expression was not a valid old syntax. With your patch it accepted this syntax and produced invalid Python program.
$ ./python -m lib2to3 -w t9.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored t9.py
--- t9.py (original)
+++ t9.py (refactored)
@@ -1 +1 @@
-print(set(x for x in range(2),))
+print((set(x for x in list(range(2)),)))
RefactoringTool: Files that were modified:
RefactoringTool: t9.py
$ ./python t9.py
File "t9.py", line 1
print((set(x for x in list(range(2)),)))
^
SyntaxError: Generator expression must be parenthesized |
|
Date |
User |
Action |
Args |
2018-07-31 13:00:26 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, benjamin.peterson, jstasiak, jayvdb, cheryl.sabella, miss-islington |
2018-07-31 13:00:26 | serhiy.storchaka | set | messageid: <1533042026.11.0.56676864532.issue27494@psf.upfronthosting.co.za> |
2018-07-31 13:00:26 | serhiy.storchaka | link | issue27494 messages |
2018-07-31 13:00:26 | serhiy.storchaka | create | |
|