[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-20 Thread Eric V. Smith
Changes by Eric V. Smith : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2fcd2540ab97 by Eric V. Smith in branch 'default': Issue 25180: Fix Tools/parser/unparse.py for f-strings. Patch by Martin Panter. https://hg.python.org/cpython/rev/2fcd2540ab97 -- nosy: +python-dev ___ P

[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-20 Thread Eric V. Smith
Eric V. Smith added the comment: That's awesome, thanks! Definitely simpler than where I was going. I'm not in front of my dev machine right now, so I can't run it. But if it works, it works. I suggest adding the test cases to test_unparse.py's UnparseTestCase. That way, any problems with thi

[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Martin Panter
Martin Panter added the comment: I think this patch should do it. No major surgery required, just a good dose of recursion :) def test_nested_fstrings(self): # Original code y = 5 self.assertEqual(f'{f"{0}"*3}', '000') self.assertEqual(f'{f"{y}"*3}', '555') self.assertEqual(f'{

[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Eric V. Smith
Eric V. Smith added the comment: This task is actually pretty difficult, and is going to require some major surgery to unparse.py. Unfortunately, until it's fixed, you can't use f-strings in the stdlib or in stdlib tests. Particularly challenging are nested f-strings like: f'{f"{0}"*3}' Gett

[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 37d3b95a289b by Eric V. Smith in branch 'default': Temporary hack for issue #25180: exclude test_fstring.py from the unparse round-tripping, while I figure out how to properly fix it. https://hg.python.org/cpython/rev/37d3b95a289b -- nosy:

[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Eric V. Smith
Eric V. Smith added the comment: And it always fails with "-u cpu", which the buildbots use. -- ___ Python tracker ___ ___ Python-bugs

[issue25180] Tools/parser/unparse.py needs to be updated for f-strings

2015-09-19 Thread Eric V. Smith
New submission from Eric V. Smith: test_unparse.py occasionally fails if it picks a module that uses f-strings. -- assignee: eric.smith keywords: easy messages: 251106 nosy: eric.smith priority: normal severity: normal stage: needs patch status: open title: Tools/parser/unparse.py needs