This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients eric.smith, mbussonn, pablogsal
Date 2019-05-22.18:17:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
> 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.
History
Date User Action Args
2019-05-22 18:17:25pablogsalsetrecipients: + pablogsal, eric.smith, mbussonn
2019-05-22 18:17:25pablogsalsetmessageid: <[email protected]>
2019-05-22 18:17:25pablogsallinkissue37003 messages
2019-05-22 18:17:25pablogsalcreate