Message360758
> 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). |
|
Date |
User |
Action |
Args |
2020-01-27 12:28:26 | pablogsal | set | recipients:
+ pablogsal, BTaskaya, Tal Ben-Nun |
2020-01-27 12:28:26 | pablogsal | set | messageid: <1580128106.16.0.12443429451.issue39463@roundup.psfhosted.org> |
2020-01-27 12:28:26 | pablogsal | link | issue39463 messages |
2020-01-27 12:28:26 | pablogsal | create | |
|