MCPcopy Index your code
hub / github.com/python/mypy / format_str_literal

Function format_str_literal

mypyc/codegen/literals.py:231–233  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

229
230
231def format_str_literal(s: str) -> bytes:
232 utf8 = s.encode("utf-8", errors="surrogatepass")
233 return format_int(len(utf8)) + utf8
234
235
236def _encode_int_values(values: dict[int, int]) -> list[bytes]:

Callers 2

_encode_str_valuesFunction · 0.85

Calls 3

format_intFunction · 0.85
lenFunction · 0.85
encodeMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…