MCPcopy
hub / github.com/psf/black / _iter_fexpr_slices

Method _iter_fexpr_slices

src/black/trans.py:1777–1786  ·  view source on GitHub ↗

Yields: All ranges of @string which, if @string were to be split there, would result in the splitting of an f-expression (which is NOT allowed).

(self, string: str)

Source from the content-addressed store, hash-verified

1775 yield begin, end
1776
1777 def _iter_fexpr_slices(self, string: str) -> Iterator[tuple[Index, Index]]:
1778 """
1779 Yields:
1780 All ranges of @string which, if @string were to be split there,
1781 would result in the splitting of an f-expression (which is NOT
1782 allowed).
1783 """
1784 if "f" not in get_string_prefix(string).lower():
1785 return
1786 yield from iter_fexpr_spans(string)
1787
1788 def _get_illegal_split_indices(self, string: str) -> set[Index]:
1789 illegal_indices: set[Index] = set()

Callers 1

Calls 2

get_string_prefixFunction · 0.90
iter_fexpr_spansFunction · 0.85

Tested by

no test coverage detected