Closed felixonmars closed 5 years ago
I'm not sure how to handle this one, so I did not submit a PR yet.
Source (from Python 3.7's dataclasses.py): f"{f.name}={{self.{f.name}!r}}"
f"{f.name}={{self.{f.name}!r}}"
Parsed as:
JoinedStr( values=[ FormattedValue(value=Attribute(value=Name(id='f'), attr='name'), conversion=-1, format_spec=None), Str(s='={self.'), FormattedValue(value=Attribute(value=Name(id='f'), attr='name'), conversion=-1, format_spec=None), Str(s='!r}')]),
which becomes a syntax error after rtrip: f'{f.name}={self.{f.name}!r}'
f'{f.name}={self.{f.name}!r}'
File "<fstring>", line 1 (self.{f.name}) ^ SyntaxError: invalid syntax
I'm not sure how to handle this one, so I did not submit a PR yet.
Source (from Python 3.7's dataclasses.py):
f"{f.name}={{self.{f.name}!r}}"
Parsed as:
which becomes a syntax error after rtrip:
f'{f.name}={self.{f.name}!r}'