[issue33991] lib2to3 should parse f-strings

2021-10-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> wont fix stage: -> resolved status: open -> closed superseder: -> Close 2to3 issues and list them here ___ Python tracker ___

[issue33991] lib2to3 should parse f-strings

2018-06-30 Thread skreft
skreft added the comment: Note also, that lib2to3 will parse invalid f-strings like f"hello {", whereas ast.parse will raise a SyntaxError exception. See below for reproduction cases: In [2]: lib2to3.tests.support.parse_string('f"hello {"') Out[2]: Node(file_input, [Node(simple_stmt, [Leaf(3

[issue33991] lib2to3 should parse f-strings

2018-06-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: > @Steven lib2to3 is no longer specifically for python 2 code, it also > parses python 3 code Ah, all good then. Thanks. -- ___ Python tracker ___

[issue33991] lib2to3 should parse f-strings

2018-06-29 Thread skreft
skreft added the comment: @Steven lib2to3 is no longer specifically for python 2 code, it also parses python 3 code and is the building block of tools like YAPF. See Eli's comment on this https://bugs.python.org/issue23894: "AFAIK lib2to3 has been repurposed to parse Python 3 as well - it ha

[issue33991] lib2to3 should parse f-strings

2018-06-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +2to3 (2.x to 3.x conversion tool) nosy: +benjamin.peterson, eric.smith ___ Python tracker ___ _

[issue33991] lib2to3 should parse f-strings

2018-06-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm curious how you are getting f-strings (introduced in Python 3.6) in Python 2 code that you are passing to 2to3. -- nosy: +steven.daprano ___ Python tracker ___

[issue33991] lib2to3 should parse f-strings

2018-06-28 Thread skreft
New submission from skreft : Currently f-strings are parsed just as regular strings by lib2to3. However, this has the problem that the invariant of a string node being a literal is now broken. This poses two problems. On one hand, if I want to compare that two string nodes are equivalent I w