Skip to content

gh-107570: Argument Clinic: report errors on the offending line - #155250

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:clinic-error-lineno
Open

gh-107570: Argument Clinic: report errors on the offending line#155250
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:clinic-error-lineno

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 5, 2026

Copy link
Copy Markdown
Member

Errors raised while the docstring is checked were reported on the line which ends the clinic block:

Error in file 'p.c' on line 11:      # the "[clinic start generated code]*/" line
Docstring for 'm.f' does not have a summary line!

and errors raised while the code is generated were reported without a file name and a line number at all:

Error:
You cannot use optional groups ('[' and ']') unless all parameters are positional-only ('/').

Functions and parameters now record the line on which they are declared, and the function docstring records where it starts, so that such errors point at the offending line: the line which should have been left blank, the too long summary line, the first too long line of the docstring body, the second {parameters} marker, or the declaration of the function or the parameter.

Errors raised while the docstring is checked were reported on the line
which ends the clinic block, and errors raised while the code is generated
were reported without a file name and a line number at all.

Functions and parameters now record the line on which they are declared,
and the function docstring records where it starts, so that such errors
point at the offending line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant