New submission from Kodiologist <nonce0010...@arfer.net>:

This works:

    𝕕𝕖𝕗 = 1

This raises SyntaxError:

    import ast
    exec(ast.unparse(ast.parse("𝕕𝕖𝕗 = 1")))

It looks like `ast.parse` creates a `Name` node with `id='def'`, which is 
correct per PEP 3131, but `ast.unparse` doesn't know it needs to mangle the 
output somehow, as "𝕕𝕖𝕗" or a similar Unicode replacement.

----------
components: Library (Lib)
messages: 411606
nosy: Kodiologist
priority: normal
severity: normal
status: open
title: `ast.unparse` produces syntactically illegal code for identifiers that 
look like reserved words
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46520>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to