Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-104050: Argument clinic: misc improvements to type annotation coverage#107206
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2640,7 +2640,7 @@ class LandMine: | ||
| # try to access any | ||
| __message__: str | ||
| def __getattribute__(self, name: str) -> Any: | ||
| if name in ('__repr__', '__message__'): | ||
| return super().__getattribute__(name) | ||
| # raise RuntimeError(repr(name)) | ||
| @@ -3896,7 +3896,7 @@ def converter_init(self, *, accept: TypeSet = {buffer}) -> None: | ||
| self.format_unit = format_unit | ||
| def cleanup(self) -> str: | ||
| name = self.name | ||
| return "".join(["if (", name, ".obj) {\n PyBuffer_Release(&", name, ");\n}\n"]) | ||
| @@ -4115,7 +4115,7 @@ def __init__( | ||
| self, | ||
| *, | ||
| py_default: str | None = None, | ||
| **kwargs: Any | ||
| ) -> None: | ||
| self.py_default = py_default | ||
| try: | ||
| @@ -4493,7 +4493,7 @@ def directive_destination( | ||
| self, | ||
| name: str, | ||
| command: str, | ||
| *args: str | ||
| ) -> None: | ||
| match command: | ||
| case "new": | ||
| @@ -4847,12 +4847,13 @@ def state_parameters_start(self, line: str | None) -> None: | ||
| return self.next(self.state_parameter, line) | ||
| def to_required(self) -> None: | ||
| """ | ||
| Transition to the "required" parameter state. | ||
| """ | ||
| if self.parameter_state is not ParamState.REQUIRED: | ||
| self.parameter_state = ParamState.REQUIRED | ||
| assert self.function is not None | ||
| for p in self.function.parameters.values(): | ||
| p.group = -p.group | ||
| @@ -5000,7 +5001,7 @@ def parse_parameter(self, line: str) -> None: | ||
| # of disallowed ast nodes. | ||
| class DetectBadNodes(ast.NodeVisitor): | ||
| bad = False | ||
| def bad_node(self, node: ast.AST) -> None: | ||
| self.bad = True | ||
| # inline function call | ||
| @@ -5248,7 +5249,9 @@ def state_parameter_docstring_start(self, line: str | None) -> None: | ||
| # every line of the docstring must start with at least F spaces, | ||
| # where F > P. | ||
| # these F spaces will be stripped. | ||
| def state_parameter_docstring(self, line: str | None) -> None: | ||
| assert line is not None | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. We need to get rid of these at some point. | ||
| stripped = line.strip() | ||
| if stripped.startswith('#'): | ||
| return | ||
| @@ -5263,7 +5266,7 @@ def state_parameter_docstring(self, line): | ||
| assert self.indent.depth == 1 | ||
| return self.next(self.state_function_docstring, line) | ||
| assert self.function and self.function.parameters | ||
| last_parameter = next(reversed(list(self.function.parameters.values()))) | ||
| new_docstring = last_parameter.docstring | ||
| @@ -5276,7 +5279,10 @@ def state_parameter_docstring(self, line): | ||
| last_parameter.docstring = new_docstring | ||
| # the final stanza of the DSL is the docstring. | ||
| def state_function_docstring(self, line: str | None) -> None: | ||
| assert self.function is not None | ||
| assert line is not None | ||
| if self.group: | ||
| fail("Function " + self.function.name + " has a ] without a matching [.") | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.