Skip to content

Commit 33586a4

Browse files
committed
Add docstring
1 parent b039967 commit 33586a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mypyc/codegen/emitfunc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,10 @@ def emit_unsigned_int_cast(self, type: RType) -> str:
913913

914914

915915
def encode_c_string_literal(b: bytes) -> str:
916+
"""Convert bytestring to the C string literal syntax (with necessary escaping).
917+
918+
For example, b'foo\n' gets coverted to 'foo\\n' (note that double quotes are not added).
919+
"""
916920
if not _translation_table:
917921
# Initialize the translation table on the first call.
918922
d = {

0 commit comments

Comments
 (0)