Skip to content

Commit d81b4f8

Browse files
gh-104050: Argument Clinic: Annotate the IndentStack class (#106934)
1 parent 1218910 commit d81b4f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tools/clinic/clinic.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4284,7 +4284,7 @@ def _ensure(self):
42844284
if not self.indents:
42854285
fail('IndentStack expected indents, but none are defined.')
42864286

4287-
def measure(self, line):
4287+
def measure(self, line: str) -> int:
42884288
"""
42894289
Returns the length of the line's margin.
42904290
"""
@@ -4298,7 +4298,7 @@ def measure(self, line):
42984298
return self.indents[-1]
42994299
return len(line) - len(stripped)
43004300

4301-
def infer(self, line):
4301+
def infer(self, line: str) -> int:
43024302
"""
43034303
Infer what is now the current margin based on this line.
43044304
Returns:
@@ -4331,19 +4331,19 @@ def infer(self, line):
43314331
return outdent_count
43324332

43334333
@property
4334-
def depth(self):
4334+
def depth(self) -> int:
43354335
"""
43364336
Returns how many margins are currently defined.
43374337
"""
43384338
return len(self.indents)
43394339

4340-
def indent(self, line):
4340+
def indent(self, line: str) -> str:
43414341
"""
43424342
Indents a line by the currently defined margin.
43434343
"""
43444344
return self.margin + line
43454345

4346-
def dedent(self, line):
4346+
def dedent(self, line: str) -> str:
43474347
"""
43484348
Dedents a line by the currently defined margin.
43494349
(The inverse of 'indent'.)

0 commit comments

Comments
 (0)