Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27494>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to