[issue30793] Parsing error on f-string-expressions containing strings with backslash

Eric V. Smith report at bugs.python.org
Wed Sep 6 19:17:36 EDT 2017


Eric V. Smith added the comment:

I'm thinking that instead of supporting backslashes in general inside expressions, I'll just special case strings.

So:
f"{'\n' if foo else ''}"
would be okay, but not:
f"{a\
}"

I think that would address the reason why \ was disallowed, but I'm going to have to go back and review the discussions to make sure.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30793>
_______________________________________


More information about the Python-bugs-list mailing list