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

Function fstring

Lib/test/test_string/_support.py:56–66  ·  view source on GitHub ↗
(template)

Source from the content-addressed store, hash-verified

54
55
56def fstring(template):
57 parts = []
58 for item in template:
59 match item:
60 case str() as s:
61 parts.append(s)
62 case Interpolation(value, _, conversion, format_spec):
63 value = convert(value, conversion)
64 value = format(value, format_spec)
65 parts.append(value)
66 return "".join(parts)

Callers 11

test_conversionsMethod · 0.90
test_debug_specifierMethod · 0.90
test_raw_tstringsMethod · 0.90
test_triple_quotedMethod · 0.90
test_basic_creationMethod · 0.90
test_pickle_templateMethod · 0.90

Calls 4

formatFunction · 0.85
convertFunction · 0.70
appendMethod · 0.45
joinMethod · 0.45

Tested by 11

test_conversionsMethod · 0.72
test_debug_specifierMethod · 0.72
test_raw_tstringsMethod · 0.72
test_triple_quotedMethod · 0.72
test_basic_creationMethod · 0.72
test_pickle_templateMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…