[issue46520] ast.unparse produces bad code for identifiers that become keywords

2022-01-29 Thread Kodiologist
Change by Kodiologist : -- keywords: +patch pull_requests: +29191 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31012 ___ Python tracker ___

[issue46520] ast.unparse produces bad code for identifiers that become keywords

2022-01-29 Thread Kodiologist
Kodiologist added the comment: (Hilariously, I couldn't post this comment on bugs.python.org due to some kind of Unicode bug ("Edit Error: 'utf8' codec can't decode bytes in position 208-210: invalid continuation byte"), so I've rendered "\U0001D555\U0001D556\U0001D557" as "DEF" in the below

[issue46520] ast.unparse produces bad code for identifiers that become keywords

2022-01-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: 'Reserved words' include all double underscore words, like __reserved__. Using such is allowed, but we reserve the right to break such code by adding a use for the word. 'def' is a keyword. Using identifier normalization to smuggle keywords into compiled c