From 01c0e933e175f3641ec46bdfb0662bf3d8af8f5c Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 21 Jul 2023 00:35:12 +0200 Subject: [PATCH] gh-104050: Argument Clinic: Annotate IndentStack() --- Tools/clinic/clinic.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 6d1796cd6135ed..36d17547e52884 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -4281,7 +4281,7 @@ def _ensure(self): if not self.indents: fail('IndentStack expected indents, but none are defined.') - def measure(self, line): + def measure(self, line: str) -> int: """ Returns the length of the line's margin. """ @@ -4295,7 +4295,7 @@ def measure(self, line): return self.indents[-1] return len(line) - len(stripped) - def infer(self, line): + def infer(self, line: str) -> int: """ Infer what is now the current margin based on this line. Returns: @@ -4328,19 +4328,19 @@ def infer(self, line): return outdent_count @property - def depth(self): + def depth(self) -> int: """ Returns how many margins are currently defined. """ return len(self.indents) - def indent(self, line): + def indent(self, line: str) -> str: """ Indents a line by the currently defined margin. """ return self.margin + line - def dedent(self, line): + def dedent(self, line: str) -> str: """ Dedents a line by the currently defined margin. (The inverse of 'indent'.)