New submission from Eric V. Smith:
The problem relates to how f-strings are re-created.
For the input file foo.txt containing this one line:
f'''{"'"}'''
Run:
./python Tools/parser/test_unparse.py foo.txt
Gives this output:
f'{"\'"}'
This result is not a valid f-string, since it contains a backslash inside the
expression part of the f-string.
The input string is a valid f-string:
>>> f'''{"'"}'''
"'"
----------
components: Demos and Tools
messages: 274841
nosy: eric.smith
priority: low
severity: normal
status: open
title: f-strings do not round trip through Tools/parser/test_unparse.py
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28002>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com