This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients BTaskaya, Tal Ben-Nun, pablogsal
Date 2020-01-27.12:28:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580128106.16.0.12443429451.issue39463@roundup.psfhosted.org>
In-reply-to
Content
> First, it breaks backward compatibility for older code that creates ast.Num without specifying kind 

The ast changes during versions, and in the current master there are no "Num" nodes, so not much we could do there sadly.

>Second, since bytes are parsed as a Constant without a kind, one can create the following (valid as of now) AST and unparse it:

You can create multiple malformed ast objects that will crash the interpreter if you pass it to `compile` or other functions that expect a valid AST. Passing invalid AST objects to these functions is out of contract (also, sanitizing that an AST is valid will make this functions much slower and will be a lot of code to maintain and CPython itself will not benefit much from it).
History
Date User Action Args
2020-01-27 12:28:26pablogsalsetrecipients: + pablogsal, BTaskaya, Tal Ben-Nun
2020-01-27 12:28:26pablogsalsetmessageid: <1580128106.16.0.12443429451.issue39463@roundup.psfhosted.org>
2020-01-27 12:28:26pablogsallinkissue39463 messages
2020-01-27 12:28:26pablogsalcreate