In a lambda expression, there might be more than one argument. To avoid splitting on the comma in this situation, increase the depth of tokens between `lambda` and `:`.
(self, leaf: Leaf)
| 186 | return False |
| 187 | |
| 188 | def maybe_increment_lambda_arguments(self, leaf: Leaf) -> bool: |
| 189 | """In a lambda expression, there might be more than one argument. |
| 190 | |
| 191 | To avoid splitting on the comma in this situation, increase the depth of |
| 192 | tokens between `lambda` and `:`. |
| 193 | """ |
| 194 | if leaf.type == token.NAME and leaf.value == "lambda": |
| 195 | self.depth += 1 |
| 196 | self._lambda_argument_depths.append(self.depth) |
| 197 | return True |
| 198 | |
| 199 | return False |
| 200 | |
| 201 | def maybe_decrement_after_lambda_arguments(self, leaf: Leaf) -> bool: |
| 202 | """See `maybe_increment_lambda_arguments` above for explanation.""" |