Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 9, 2025

…orator is followed by a comment or an empty line
Copy link
Member

@vstinner vstinner left a 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?

@picnixz
Copy link
Member

picnixz commented Oct 9, 2025

See https://docs.python.org/3/library/token.html#token.NEWLINE:

Token value that indicates the end of a logical line.

and https://docs.python.org/3/library/token.html#token.NL:

Token value used to indicate a non-terminating newline. NL tokens are generated when a logical line of code is continued over multiple physical lines. The parser ignores NL tokens.

@serhiy-storchaka serhiy-storchaka merged commit f4104f5 into python:main Oct 10, 2025
51 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the inspect-getsourcelines-comment-after-decorator branch October 10, 2025 07:51
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 10, 2025
…orator is followed by a comment or an empty line (pythonGH-139836)

(cherry picked from commit f4104f5)

Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 10, 2025
…orator is followed by a comment or an empty line (pythonGH-139836)

(cherry picked from commit f4104f5)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 10, 2025

GH-139889 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Oct 10, 2025
@bedevere-app
Copy link

bedevere-app bot commented Oct 10, 2025

GH-139890 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 10, 2025
serhiy-storchaka added a commit that referenced this pull request Oct 10, 2025
…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]>
serhiy-storchaka added a commit that referenced this pull request Oct 10, 2025
…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]>
Yhg1s pushed a commit to Yhg1s/cpython that referenced this pull request Oct 14, 2025
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants