X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a24e1f795975350f7b1d8898d831916a9f6dbc6a..911b59fb4f39a612f0c9e5350b78d7b37f5ed491:/src/black/nodes.py?ds=sidebyside diff --git a/src/black/nodes.py b/src/black/nodes.py index f130bff..d18d4bd 100644 --- a/src/black/nodes.py +++ b/src/black/nodes.py @@ -9,6 +9,7 @@ from typing import ( List, Optional, Set, + Tuple, TypeVar, Union, ) @@ -559,9 +560,14 @@ def is_one_tuple(node: LN) -> bool: ) -def is_one_tuple_between(opening: Leaf, closing: Leaf, leaves: List[Leaf]) -> bool: - """Return True if content between `opening` and `closing` looks like a one-tuple.""" - if opening.type != token.LPAR and closing.type != token.RPAR: +def is_one_sequence_between( + opening: Leaf, + closing: Leaf, + leaves: List[Leaf], + brackets: Tuple[int, int] = (token.LPAR, token.RPAR), +) -> bool: + """Return True if content between `opening` and `closing` is a one-sequence.""" + if (opening.type, closing.type) != brackets: return False depth = closing.bracket_depth + 1