Message411742
Technically, this is a bug on the fact that it breaks the only guarantee of ast.unparse:
> Unparse an ast.AST object and generate a string with code that would produce an equivalent ast.AST object if parsed back with ast.parse().
But I am not really sure if it should be handled at all, since we don't have access to the original form of the identifier in the AST due to the parser's normalization behavior.
If we want to only create a source that would give the same AST, abusing the fact that original keywords are always basic ASCII we could embed a map of characters that convert ASCII 'a', 'b', 'c', ... to their most similar unicode versions (https://util.unicode.org/UnicodeJsps/confusables.jsp). But I feel like this is a terrible idea, with no possible gain (very limited use case) and very prone to a lot of confusions.
I think just adding a warning to the documentation regarding this should be the definite resolution, unless @pablogsal has any other idea. |
|
Date |
User |
Action |
Args |
2022-01-26 11:56:36 | BTaskaya | set | recipients:
+ BTaskaya, benjamin.peterson, JelleZijlstra, Kodiologist, pablogsal, sobolevn |
2022-01-26 11:56:35 | BTaskaya | set | messageid: <1643198195.64.0.877913865567.issue46520@roundup.psfhosted.org> |
2022-01-26 11:56:35 | BTaskaya | link | issue46520 messages |
2022-01-26 11:56:35 | BTaskaya | create | |
|