Add explode_split to documentation

This commit is contained in:
Łukasz Langa 2018-04-24 14:27:21 -07:00
parent 1445bea97e
commit b62bd4de75
2 changed files with 4 additions and 1 deletions

View File

@ -1984,13 +1984,14 @@ def append_to_line(leaf: Leaf) -> Iterator[Line]:
def explode_split(
line: Line, py36: bool = False, omit: Collection[LeafID] = ()
) -> Iterator[Line]:
"""Split by RHS and immediately split contents by a delimiter."""
"""Split by rightmost bracket and immediately split contents by a delimiter."""
new_lines = list(right_hand_split(line, py36, omit))
if len(new_lines) != 3:
yield from new_lines
return
yield new_lines[0]
try:
yield from delimiter_split(new_lines[1], py36)
except CannotSplit:

View File

@ -60,6 +60,8 @@ Split functions
.. autofunction:: black.delimiter_split
.. autofunction:: black.explode_split
.. autofunction:: black.left_hand_split
.. autofunction:: black.right_hand_split