Can you give any examples of problems caused by the ast not being standardized? The original motivation of being able to distinguish between foo(x: int) foo(x: "int") isn't very compelling – it's not clear it's a problem in the first place, and even if it is then all we need is some kind of boolean flag, not an ast standard.
On Nov 13, 2017 13:38, "Greg Ewing" <greg.ew...@canterbury.ac.nz> wrote: > Guido van Rossum wrote: > >> But Python's syntax changes in nearly every release. >> > > The changes are almost always additions, so there's no > reason why the AST can't remain backwards compatible. > > the AST level ... elides many details (such as whitespace and parentheses). >> > > That's okay, because the AST is only expected to > represent the semantics of Python code, not its > exact lexical representation in the source. It's > the same with Lisp -- comments and whitespace have > been stripped out by the time you get to Lisp > data. > > Lisp had almost no syntax so I presume the mapping to data structures was >> nearly trivial compared to Python. >> > > Yes, the Python AST is more complicated, but we > already have that much complexity in the AST being > used by the compiler. > > If I understand correctly, we also have a process > for converting that internal structure to and from > an equally complicated set of Python objects, that > isn't needed by the compiler and exists purely for > the convenience of Python code. > > I can't see much complexity being added if we were > to decide to standardise the Python representation. > > -- > Greg > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/njs% > 40pobox.com >
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com