Produce contents of a C string literal for a byte string, without quotes.
(b: bytes)
| 41 | |
| 42 | |
| 43 | def encode_bytes_as_c_string(b: bytes) -> str: |
| 44 | """Produce contents of a C string literal for a byte string, without quotes.""" |
| 45 | escaped = "".join([CHAR_MAP[i] for i in b]) |
| 46 | return escaped |
| 47 | |
| 48 | |
| 49 | def c_string_initializer(value: bytes) -> str: |
no test coverage detected
searching dependent graphs…