Message411780
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? |
|
| Date |
User |
Action |
Args |
| 2022-01-26 17:06:51 | Kodiologist | set | recipients:
+ Kodiologist, benjamin.peterson, JelleZijlstra, pablogsal, BTaskaya, sobolevn |
| 2022-01-26 17:06:51 | Kodiologist | set | messageid: <1643216811.33.0.691273863725.issue46520@roundup.psfhosted.org> |
| 2022-01-26 17:06:51 | Kodiologist | link | issue46520 messages |
| 2022-01-26 17:06:51 | Kodiologist | create | |
|