Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code_gen omits docstrings on Python 3.7 #101

Closed
Kodiologist opened this issue Mar 26, 2018 · 2 comments
Closed

code_gen omits docstrings on Python 3.7 #101

Kodiologist opened this issue Mar 26, 2018 · 2 comments

Comments

@Kodiologist
Copy link
Contributor

$ python -c 'import ast, astor; print(astor.code_gen.to_source(ast.Module(body = [ast.parse("def f():\n \"docstring\"\n 1")])) )'
def f():
    1

$ python -c 'import ast, astor; print(astor.code_gen.to_source(ast.Module(body = [ast.parse("class C:\n \"docstring\"\n 1")])) )'
class C:
    1

$ python -c 'import ast, astor; print(astor.code_gen.to_source(ast.Module(body = [ast.parse("\"hello\"\n1")])))' 
1
@berkerpeksag
Copy link
Owner

I assume the cause of this is the new node.docstring attribute in 3.7?

@Kodiologist
Copy link
Contributor Author

That seems like a good bet.

radomirbosak added a commit to radomirbosak/astor that referenced this issue May 3, 2018
radomirbosak added a commit to radomirbosak/astor that referenced this issue May 3, 2018
radomirbosak added a commit to radomirbosak/astor that referenced this issue May 3, 2018
radomirbosak added a commit to radomirbosak/astor that referenced this issue May 3, 2018
radomirbosak added a commit to radomirbosak/astor that referenced this issue May 4, 2018
radomirbosak added a commit to radomirbosak/astor that referenced this issue May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants