]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104050: Annotate Argument Clinic DSLParser attributes (#106357)
authorErlend E. Aasland <erlend@python.org>
Mon, 3 Jul 2023 10:06:54 +0000 (12:06 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Jul 2023 10:06:54 +0000 (10:06 +0000)
Tools/clinic/clinic.py

index 27d3d572868883585ad2c25a147c7e479046b078..125604bff97f7c48826a03f8f1ab65085ac75ee5 100755 (executable)
@@ -4293,6 +4293,19 @@ class IndentStack:
 StateKeeper = Callable[[str | None], None]
 
 class DSLParser:
+    function: Function | None
+    state: StateKeeper
+    keyword_only: bool
+    positional_only: bool
+    group: int
+    parameter_state: int
+    seen_positional_with_default: bool
+    indent: IndentStack
+    kind: str
+    coexist: bool
+    parameter_continuation: str
+    preserve_output: bool
+
     def __init__(self, clinic: Clinic) -> None:
         self.clinic = clinic
 
@@ -4312,7 +4325,7 @@ class DSLParser:
 
     def reset(self) -> None:
         self.function = None
-        self.state: StateKeeper = self.state_dsl_start
+        self.state = self.state_dsl_start
         self.parameter_indent = None
         self.keyword_only = False
         self.positional_only = False