8000 gh-104050: Annotate more Argument Clinic DSLParser state methods by erlend-aasland · Pull Request #106376 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104050: Annotate more Argument Clinic DSLParser state methods #106376

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into clinic/annotate-state-parameter
  • Loading branch information
AlexWaygood authored Jul 3, 2023
commit 2bd134f1a478675cd71e095a3054f0f7c1e7a758
5 changes: 3 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
5FD5 Expand Up @@ -4884,8 +4884,9 @@ def state_parameter(self, line: str | None) -> None:
name, legacy, kwargs = self.parse_converter(parameter.annotation)

if not default:
if self.parameter_state == self.ps_optional:
fail("Can't have a parameter without a default (" + repr(parameter_name) + ")\nafter a parameter with a default!")
if self.parameter_state is ParamState.OPTIONAL:
fail(f"Can't have a parameter without a default ({parameter_name!r})\n"
"after a parameter with a default!")
value: Sentinels | Null
if is_vararg:
value = NULL
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0