-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-39031: Include elif keyword when producing lineno/col-offset info for if_stmt #17582
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
Conversation
Hi there 😉 Can you add a NEWS entry? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a elif
case to the exec_test
list and regenerate the test data (check the end of the file for instructions)?
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Misc/NEWS.d/next/Core and Builtins/2019-12-12-21-05-43.bpo-39031.imlCYZ.rst
Outdated
Show resolved
Hide resolved
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
Thanks a lot for the review @pablogsal! I have made the requested changes; please review again. |
Thanks for making the requested changes! @pablogsal: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch @lysnikolaou! I will backport this to 3.8
and 3.7
once the CI finish.
@lysnikolaou: Status check is done, and it's a failure ❌ . |
@lysnikolaou: Status check is done, and it's a success ✅ . |
Thanks @lysnikolaou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
Thanks @lysnikolaou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
I'm having trouble backporting to |
Thanks @lysnikolaou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry @lysnikolaou, I had trouble checking out the |
Thanks @lysnikolaou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
GH-17589 is a backport of this pull request to the 3.8 branch. |
… for if_stmt (pythonGH-17582) When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node. https://bugs.python.org/issue39031 Automerge-Triggered-By: @pablogsal (cherry picked from commit 025a602) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
…t info for if_stmt (GH-17582) (#17584) When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node. https://bugs.python.org/issue39031 Automerge-Triggered-By: @pablogsal. (cherry picked from commit 025a602) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
… for if_stmt (GH-17582) (GH-17589) When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node. https://bugs.python.org/issue39031 Automerge-Triggered-By: @pablogsal (cherry picked from commit 025a602) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
@pablogsal I just found out that I kind of messed this up and one more change is needed. What is the right course of action here? Open a new PR for the additional change? |
Yes, also explain in the issue what is missing |
@pablogsal In the past these usually don't get backported to already-released versions as they break static analysis tools (I just hit an error due to this patch when upgrading from 3.8.0 to 3.8.1+!) |
@asottile Apologies for the inconvenience :S. In this case I backported it because I considered this a bugfix but I can see how this can be inconvenient for static analysers. Although static analysers would break anyway with a new major release I will make sure to take this into account for further similar situations so we don't cause breakage for minor releases. |
yep makes sense, in major versions breakage is ~kinda expected -- but having conditions for oh actually it appears this isn't released in 3.8.1 so it would be part of 3.8.2? should we revert instead? |
Unless I am mistaken, the fixes for issue39031 are in 3.8.1 and the latest 3.7.x because we are relying on that for developing pegen. |
ah yep they are -- false alarm. I'm bad at reading |
Notice that this fixes are also on the latest 3.7.x :( |
ugh that's even messier :( |
@asottile But notice this is not unique of this issue, for example https://bugs.python.org/issue38535 also changes ast colum offsets and line numbers and was backported (for example, is in 3.7.6). |
bpo-16806 was not for instance -- and there was a change to the tokenizer in a patch version which pretty badly broke pyflakes + pycodestyle but I'm having a difficult time finding it (it involved ideally we'd document this somewhere and be more consistent 🤷♂️ |
… for if_stmt (pythonGH-17582) When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node. https://bugs.python.org/issue39031 Automerge-Triggered-By: @pablogsal
When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node.
https://bugs.python.org/issue39031
Automerge-Triggered-By: @pablogsal