[issue37003] ast unparse does not support f-string new debug format.

Matthias Bussonnier report at bugs.python.org
Wed May 22 13:47:18 EDT 2019


Matthias Bussonnier <bussonniermatthias at gmail.com> added the comment:

I thought it was comparing the AST of the file to the AST of the unparsed
AST.

So it's actually checking if parse(unparse(x)) is indempotent and not
wether parse(unparse(x)) is indempotent.

So x={x!r} should be fine.

On Wed, May 22, 2019, 09:22 Pablo Galindo Salgado <report at bugs.python.org>
wrote:

>
> Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:
>
> Notice that test_tools will fail if  f'{x=}' becomes f'x={x!r}' when
> unparsed as it compares the text of the file and the text of the roundtrip
> of the ast of the file
>
> ----------
> nosy: +pablogsal
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue37003>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37003>
_______________________________________


More information about the Python-bugs-list mailing list