[issue39639] Remove Suite node from AST

Jeff Allen report at bugs.python.org
Sat Feb 22 15:35:32 EST 2020


Jeff Allen <ja.py at farowl.co.uk> added the comment:

Jython uses the reference grammar and ASDL as a way to ensure it is Python we approximate, not some subtly different language. The presence of Suite here gives rise to a class (https://github.com/jythontools/jython/blob/v2.7.2b3/src/org/python/antlr/ast/Suite.java) and we actually use instances of it in the compiler (https://github.com/jythontools/jython/blob/v2.7.2b3/src/org/python/compiler/CodeCompiler.java#L2389).

It is a bit of a wart, to have a Jython-specific type here: somewhat defeating the object of using the same source. I expect there was a good reason: perhaps there was no better way to express the commonality between Interactive and Module. It was all before my involvement.

I would try to avoid needing it in Jython 3, and if we can't, it doesn't look hard to manage the variation our copy. It's not like we copy these files mechanically from from CPython during a build.

+1 on removing it.

----------
nosy: +jeff.allen

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39639>
_______________________________________


More information about the Python-bugs-list mailing list