MCPcopy Create free account
hub / github.com/python/cpython / wrapped_c_string_literal

Function wrapped_c_string_literal

Tools/clinic/libclinic/formatting.py:93–109  ·  view source on GitHub ↗
(
    text: str,
    *,
    width: int = 72,
    suffix: str = "",
    initial_indent: int = 0,
    subsequent_indent: int = 4
)

Source from the content-addressed store, hash-verified

91
92
93def wrapped_c_string_literal(
94 text: str,
95 *,
96 width: int = 72,
97 suffix: str = "",
98 initial_indent: int = 0,
99 subsequent_indent: int = 4
100) -> str:
101 wrapped = textwrap.wrap(
102 text,
103 width=width,
104 replace_whitespace=False,
105 drop_whitespace=False,
106 break_on_hyphens=False,
107 )
108 separator = '"' + suffix + "\n" + subsequent_indent * " " + '"'
109 return initial_indent * " " + '"' + separator.join(wrapped) + '"'
110
111
112def _add_prefix_and_suffix(text: str, *, prefix: str = "", suffix: str = "") -> str:

Callers

nothing calls this directly

Calls 2

wrapMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…