MCPcopy Index your code
hub / github.com/python/cpython / c_id

Function c_id

Tools/clinic/libclinic/clanguage.py:24–31  ·  view source on GitHub ↗
(name: str)

Source from the content-addressed store, hash-verified

22
23
24def c_id(name: str) -> str:
25 if len(name) == 1 and ord(name) < 256:
26 if name.isalnum():
27 return f"_Py_LATIN1_CHR('{name}')"
28 else:
29 return f'_Py_LATIN1_CHR({ord(name)})'
30 else:
31 return f'&_Py_ID({name})'
32
33
34class CLanguage(Language):

Callers 2

deprecate_keyword_useMethod · 0.85
render_functionMethod · 0.85

Calls 1

isalnumMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…