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

Function convert

Lib/test/test_string/_support.py:46–53  ·  view source on GitHub ↗
(value, conversion)

Source from the content-addressed store, hash-verified

44
45
46def convert(value, conversion):
47 if conversion == "a":
48 return ascii(value)
49 elif conversion == "r":
50 return repr(value)
51 elif conversion == "s":
52 return str(value)
53 return value
54
55
56def fstring(template):

Callers 5

fstringFunction · 0.70
test_conversion_intMethod · 0.50
test_conversion_badMethod · 0.50

Calls 2

asciiFunction · 0.85
strFunction · 0.85

Tested by 4

test_conversion_intMethod · 0.40
test_conversion_badMethod · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…