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

Function native_class_doc_initializer

mypyc/codegen/emitclass.py:1295–1305  ·  view source on GitHub ↗
(cl: ClassIR)

Source from the content-addressed store, hash-verified

1293
1294
1295def native_class_doc_initializer(cl: ClassIR) -> str:
1296 init_fn = cl.get_method("__init__")
1297 if init_fn is not None:
1298 text_sig = get_text_signature(init_fn, bound=True)
1299 if text_sig is None:
1300 return "NULL"
1301 text_sig = text_sig.replace("__init__", cl.name, 1)
1302 else:
1303 text_sig = f"{cl.name}()"
1304 docstring = f"{text_sig}\n--\n\n"
1305 return c_string_initializer(docstring.encode("ascii", errors="backslashreplace"))
1306
1307
1308def generate_coroutine_setup(

Callers 1

generate_classFunction · 0.85

Calls 5

get_text_signatureFunction · 0.90
c_string_initializerFunction · 0.90
replaceMethod · 0.80
encodeMethod · 0.80
get_methodMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…