Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

> 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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39463>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to