MCPcopy
hub / github.com/psf/black / maybe_decrement_after_lambda_arguments

Method maybe_decrement_after_lambda_arguments

src/black/brackets.py:201–212  ·  view source on GitHub ↗

See `maybe_increment_lambda_arguments` above for explanation.

(self, leaf: Leaf)

Source from the content-addressed store, hash-verified

199 return False
200
201 def maybe_decrement_after_lambda_arguments(self, leaf: Leaf) -> bool:
202 """See `maybe_increment_lambda_arguments` above for explanation."""
203 if (
204 self._lambda_argument_depths
205 and self._lambda_argument_depths[-1] == self.depth
206 and leaf.type == token.COLON
207 ):
208 self.depth -= 1
209 self._lambda_argument_depths.pop()
210 return True
211
212 return False
213
214 def get_open_lsqb(self) -> Leaf | None:
215 """Return the most recent opening square bracket (if any)."""

Callers 1

markMethod · 0.95

Calls 1

popMethod · 0.80

Tested by

no test coverage detected