-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-139783: Fix inspect.getsourcelines() for the case when a decorator is followed by a comment or an empty line #139836
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
…orator is followed by a comment or an empty line
vstinner
left a comment
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.
LGTM
I'm just curious, what's the difference between tokenize.NL and tokenize.NEWLINE?
|
See https://docs.python.org/3/library/token.html#token.NEWLINE:
and https://docs.python.org/3/library/token.html#token.NL:
|
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…orator is followed by a comment or an empty line (pythonGH-139836) (cherry picked from commit f4104f5) Co-authored-by: Serhiy Storchaka <[email protected]>
…orator is followed by a comment or an empty line (pythonGH-139836) (cherry picked from commit f4104f5) Co-authored-by: Serhiy Storchaka <[email protected]>
|
GH-139889 is a backport of this pull request to the 3.14 branch. |
|
GH-139890 is a backport of this pull request to the 3.13 branch. |
…corator is followed by a comment or an empty line (GH-139836) (GH-139889) (cherry picked from commit f4104f5) Co-authored-by: Serhiy Storchaka <[email protected]>
…corator is followed by a comment or an empty line (GH-139836) (GH-139890) (cherry picked from commit f4104f5) Co-authored-by: Serhiy Storchaka <[email protected]>
…n a decorator is followed by a comment or an empty line (pythonGH-139836) (pythonGH-139890) (cherry picked from commit f4104f5) Co-authored-by: Serhiy Storchaka <[email protected]>
inspect.BlockFinderhandlestokenize.NEWLINEtoo strictly #139783