Add explode_split
to documentation
This commit is contained in:
parent
1445bea97e
commit
b62bd4de75
3
black.py
3
black.py
@ -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:
|
||||
|
@ -60,6 +60,8 @@ Split functions
|
||||
|
||||
.. autofunction:: black.delimiter_split
|
||||
|
||||
.. autofunction:: black.explode_split
|
||||
|
||||
.. autofunction:: black.left_hand_split
|
||||
|
||||
.. autofunction:: black.right_hand_split
|
||||
|
Loading…
Reference in New Issue
Block a user