Message343227
> Notice that test_tools will fail if f'{x=}' becomes f'x={x!r}'
I arrived at the wrong conclusion as Matthias points out.
>>> import ast
>>> ast.dump(compile("f'{x=}'","<string>","exec",ast.PyCF_ONLY_AST))
"Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=114, format_spec=None, expr_text='x=')]))], type_ignores=[])"
>>> ast.dump(compile("f'{x!r}'","<string>","exec",ast.PyCF_ONLY_AST))
"Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=114, format_spec=None, expr_text=None)]))], type_ignores=[])"
if expr_text is removed those strings will be the same, so we will be ok. Sorry for the confusion. |
|
| Date |
User |
Action |
Args |
| 2019-05-22 18:17:25 | pablogsal | set | recipients:
+ pablogsal, eric.smith, mbussonn |
| 2019-05-22 18:17:25 | pablogsal | set | messageid: <[email protected]> |
| 2019-05-22 18:17:25 | pablogsal | link | issue37003 messages |
| 2019-05-22 18:17:25 | pablogsal | create | |
|