Kodiologist <nonce0010...@arfer.net> added the comment:

I've done very little work on CPython, but I do a lot of AST construction and 
call `ast.unparse` a lot in my work on Hylang, and I think this is a wart worth 
fixing. The real mistake was letting the user say `𝕕𝕖𝕗 = 1`, but that's been 
legal Python syntax for a long time, so I doubt a change to that would be 
welcome, especially one affecting old stable versions of Python like 3.9. 
Python has made its bed and now it must lie in it.

I think that with a pretty small amount of code (using code-point arithmetic 
instead of a dictionary with every ASCII letter), I can add Unicode "escaping" 
of reserved words to the part of `ast.unparse` that renders variable names. 
Would a patch of this kind be welcome?

----------

_______________________________________
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