[issue29622] ast module doesn't support optional fields of Parser/Python.asdl

Matthias Bussonnier report at bugs.python.org
Wed Feb 22 11:54:54 EST 2017


Matthias Bussonnier added the comment:

Duplicating my comment of 29463 who was in a race condition with this issue:

----
thank you for your work on the AST, I know many developers are looking forward to improvement and stabilisation with the hope of having it stable (and documented) in the stdlib at some point. 

The recent change in PR 46 now change (at least) the constructor of `ast.Module` to take a second mandatory parameter (the docstring). 

I know the ast is autogenerated and "use at your own risk". But IPython for example, use `mod = ast.Module([nodes])`, with the second mandatory parameter added to Module that make it incompatible with current Python 3.7. 
Well it's long until it's released, and we can patch things, but I'm sure we are not the only one in this case, and we'd like older version of IPython to still be compatible with Python 3.7, so if  `Module()`'s second parameter (the docstring) could be optional, that would be great. 

I would be happy if it raise a deprecation warning that it will be required in the future.

I'm of course speaking about `Module` because that's the first error I encountered, but I'm guessing it applies to other changed AST nodes. 

Thanks.
---

----------
nosy: +mbussonn

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29622>
_______________________________________


More information about the Python-bugs-list mailing list