-
Notifications
You must be signed in to change notification settings - Fork 179
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
Support Python 3.7 #271
Comments
I got some responses from the Python bug tracker. They confirm my suspicion that there is no longer an easy way to get the line number of a docstring. The doctest checking feature has been disabled by default since 5207ca6. I'm not sure if I've even used this feature before. My main interest was just to get the unit tests passing in Python 3.7. I think @jayvdb has worked with the doctest parsing code the most recently out of all of us. And I think @mgedmin contributed the doctest checking feature in 5e962f0. What do you guys think would be the appropriate approach to this problem? |
I'm fine with the simplifying assumption that a docstring starts on the next line after the function definition. Incorrect line numbers in warnings are better than a completely broken feature. At some point somebody will be sufficiently annoyed that they'll contribute a fix to make the line numbers correct, even if they do so by inspecting the source file to find the first |
So here is the option we are discussing in code: |
That looks acceptable to me. |
I'm moving #90 (comment) here since we have GitHub issue support now.
It looks like the CPython 3.7 failure is related to a change in the AST. The docstring is no longer in
node.body
.python/cpython#46
We can mostly replace our
getDocstring(node.body[0])
call withnode.docstring
. But I'm not sure how to get the line number of the docstring anymore.node.lineno
is close, but not quite the line number of the docstring.pyflakes/pyflakes/checker.py
Line 873 in 074c21d
I've reported this to the CPython issue tracker.
The text was updated successfully, but these errors were encountered: