Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commented Jan 3, 2025

Resolves#128152

@erlend-aaslanderlend-aasland changed the title clinic/empty commentsgh-128152: Argument Clinic: don't parse CPP directives inside C commentsJan 3, 2025
@erlend-aaslanderlend-aasland added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jan 3, 2025
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

I'm not an expert in AC but this looks good. At least, I can now use empty lines in python input. By the way, I think I've just understood that CPP stands for Clinic Pre-Processor/Processing and not for C++....

@erlend-aasland
Copy link
ContributorAuthor

I can now use empty lines in python input

Yes, # prefixed lines are now correctly passed on as Python code. For clinic input blocks, they are correctly ignored as "Clinic comments":

defvalid_line(self, line: str) ->bool:
# ignore comment-only lines
ifline.lstrip().startswith('#'):
returnFalse

@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commented Jan 3, 2025

Thanks for the quick review! I'll land this tomorrow.

@erlend-aaslanderlend-aasland self-assigned this Jan 3, 2025
@erlend-aaslanderlend-aasland merged commit a4e773c into python:mainJan 4, 2025
52 checks passed
@erlend-aaslanderlend-aasland deleted the clinic/empty-comments branch January 4, 2025 10:46
@miss-islington-app

This comment was marked as outdated.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 4, 2025
…ide C comments (pythonGH-128464) (cherry picked from commit a4e773c) Co-authored-by: Erlend E. Aasland <erlend@python.org>
@miss-islington-app

This comment was marked as outdated.

@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Jan 4, 2025
@erlend-aaslanderlend-aasland removed the needs backport to 3.12 only security fixes label Jan 4, 2025
erlend-aasland added a commit that referenced this pull request Jan 4, 2025
…side C comments (GH-128464) (#128478) (cherry picked from commit a4e773c) Co-authored-by: Erlend E. Aasland <erlend@python.org>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 6, 2025
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
Sign up for freeto 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.

Argument Clinic's [python input] blocks do not support empty lines in comments

2 participants

@erlend-aasland@picnixz