[New-bugs-announce] [issue39638] Keep ASDL signatures for AST nodes

Batuhan Taskaya report at bugs.python.org
Sat Feb 15 06:32:26 EST 2020


New submission from Batuhan Taskaya <batuhanosmantaskaya at gmail.com>:

It would be super convenient to keep ASDL declarations in AST nodes. There are multiple benefits of it;

1 -> When debugging or playing with the AST, time to time you may require to know what kind of things a field gets or is that field an optional one. 

2 -> The AST nodes are pretty limited on what can they do by default. For extending their scope, 3rd party tools often copy python's ASDL to their source and build custom AST nodes from that. And with knowing what every field gets they can automatically generate autotransformer codes from that ASDL spec which takes python's standard AST and convert it to their own AST nodes. 

We can either create a new attribute or keep this in the docstring. I think keeping this in the docstring can at least give some info about the node rather than None so it makes more sense to me. If the feature wanted, I can propose a PR.

----------
components: Library (Lib)
messages: 362012
nosy: BTaskaya, benjamin.peterson, pablogsal
priority: low
severity: normal
status: open
title: Keep ASDL signatures for AST nodes
type: enhancement
versions: Python 3.9

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


More information about the New-bugs-announce mailing list