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

Function hexrepr

Tools/unicode/gencodec.py:123–136  ·  view source on GitHub ↗
(t, precision=4)

Source from the content-addressed store, hash-verified

121 return enc2uni
122
123def hexrepr(t, precision=4):
124
125 if t is None:
126 return 'None'
127 try:
128 len(t)
129 except TypeError:
130 return '0x%0*X' % (precision, t)
131 try:
132 return '(' + ', '.join(['0x%0*X' % (precision, item)
133 for item in t]) + ')'
134 except TypeError as why:
135 print('* failed to convert %r: %s' % (t, why))
136 raise
137
138def python_mapdef_code(varname, map, comments=1, precisions=(2, 4)):
139

Callers 2

python_mapdef_codeFunction · 0.85
python_tabledef_codeFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…