[issue38568] [3.7.5 x86_64 Linux] f-string parsing results in EOL

2019-10-29 Thread Eric V. Smith
Eric V. Smith added the comment: > It is a limitation of f-strings, though. We're not allowed to use > backslashes within the f-string expression in curly braces. I've considered relaxing these restrictions, although it's very complicated. The parser would need to become aware of what's

[issue38568] [3.7.5 x86_64 Linux] f-string parsing results in EOL

2019-10-23 Thread Ying Wang
Ying Wang added the comment: Oh cool, I didn't know triple quotes can be used as part of f-strings! Thanks for the explanation! -- ___ Python tracker ___

[issue38568] [3.7.5 x86_64 Linux] f-string parsing results in EOL

2019-10-23 Thread Hobs
Hobs added the comment: It is a limitation of f-strings, though. We're not allowed to use backslashes within the f-string expression in curly braces. So to do what you want you have to create another variable containing the quote character: ``` >>> blah = '"hi"' >>> blah '"hi"' >>> q = '"'

[issue38568] [3.7.5 x86_64 Linux] f-string parsing results in EOL

2019-10-23 Thread Hobs
Hobs added the comment: Not a bug. If you use quotes inside an f-string (or any other kind of string) they need to be escaped. --Hobson On Wed, Oct 23, 2019 at 12:09 PM Ying Wang wrote: > > New submission from Ying Wang : > > Hey, > > I encountered an interesting bug when trying to do

[issue38568] [3.7.5 x86_64 Linux] f-string parsing results in EOL

2019-10-23 Thread Zachary Ware
Zachary Ware added the comment: This is because you're trying to use the string's delimiting character (') in the string itself, which won't work for fairly apparent reasons :). Try removing the `f` prefix and see what happens. You can get around this by using a triple-quoted string which

[issue38568] [3.7.5 x86_64 Linux] f-string parsing results in EOL

2019-10-23 Thread Ying Wang
New submission from Ying Wang : Hey, I encountered an interesting bug when trying to do string parsing using f-strings. I am currently under the impression that within the curly braces is any expression that can be successfully evaluated in a REPL. Here's the error: ```bash