macropy
macropy copied to clipboard
A custom AST hierarchy for our own use
The default python AST objects are clunky and annoying:
- They don't have nice
__str__
s or__repr__
s - They don't have a constructor that will work with pattern matching
- They don't have structural equality
- Behave differently in CPython, PyPy and Jython and are probably the main reason why Jython doesn't work right now.
In general they are a pain to use. It would be great if we could have a different ast representation, either using astng
or made ourselves using case classes.
Can you direct me to where we're using or parsing the AST?
Astroid doesn't parse generators yet. See https://bitbucket.org/logilab/astroid/issue/94/add-an-infer_call_result-method-for
I don't understand how the absence of infer_call_result has any relevance to MacroPy, it looks like it's there for checking function return/call sign signatures for Pylint.