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

bpo-38870: Docstring support for function/class/module nodes #17760

Merged
merged 12 commits into from
Mar 2, 2020

Conversation

isidentical
Copy link
Sponsor Member

@isidentical isidentical commented Dec 30, 2019

@pablogsal
Copy link
Member

@isidentical Can you rebase this against the latest master? Ping me when is ready and I can do another review

Lib/ast.py Outdated Show resolved Hide resolved
isidentical and others added 2 commits March 1, 2020 23:28
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
Lib/ast.py Outdated Show resolved Hide resolved
Lib/ast.py Outdated Show resolved Hide resolved
Lib/ast.py Outdated Show resolved Hide resolved
@codecov

This comment has been minimized.

Lib/test/test_unparse.py Outdated Show resolved Hide resolved
Lib/test/test_unparse.py Outdated Show resolved Hide resolved
Lib/test/test_unparse.py Outdated Show resolved Hide resolved
Lib/test/test_unparse.py Outdated Show resolved Hide resolved
Lib/test/test_unparse.py Outdated Show resolved Hide resolved
@@ -360,6 +361,9 @@ def test_docstrings(self):
self.check_src_roundtrip(f"{prefix}{docstring}")

def test_docstrings_negative_cases(self):
# Test some cases that involve strings in the children of the
# first node but aren't docstrings to make sure we don't have
# False positives.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# False positives.
# false positives.

Copy link
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Great job, @isidentical 💪 🎉

@pablogsal pablogsal merged commit 89aa469 into python:master Mar 2, 2020
@isidentical isidentical deleted the bpo-38870-docstrings branch March 2, 2020 18:59
sthagen added a commit to sthagen/python-cpython that referenced this pull request Mar 2, 2020
bpo-38870: Add docstring support to ast.unparse (pythonGH-17760)
colesbury referenced this pull request in colesbury/nogil Oct 6, 2021
Allow ast.unparse to detect docstrings in functions, modules and classes and produce
nicely formatted unparsed output for said docstrings.

Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants