Commit b62bd4de authored by Łukasz Langa's avatar Łukasz Langa
Browse files

Add `explode_split` to documentation

parent 1445bea9
Loading
Loading
Loading
Loading
+2 −1
Changes for black.py: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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:
+2 −0
Changes for docs/reference/reference_functions.rst: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -60,6 +60,8 @@ Split functions

.. autofunction:: black.delimiter_split

.. autofunction:: black.explode_split

.. autofunction:: black.left_hand_split

.. autofunction:: black.right_hand_split