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

Function c_string_initializer

mypyc/codegen/cstring.py:49–54  ·  view source on GitHub ↗

Create initializer for a C char[]/ char * variable from a string. For example, if value if b'foo', the result would be '"foo"'.

(value: bytes)

Source from the content-addressed store, hash-verified

47
48
49def c_string_initializer(value: bytes) -> str:
50 """Create initializer for a C char[]/ char * variable from a string.
51
52 For example, if value if b'foo', the result would be '"foo"'.
53 """
54 return '"' + encode_bytes_as_c_string(value) + '"'

Callers 3

Calls 1

encode_bytes_as_c_stringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…