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

Method convert_field

Lib/string/__init__.py:277–287  ·  view source on GitHub ↗
(self, value, conversion)

Source from the content-addressed store, hash-verified

275 return format(value, format_spec)
276
277 def convert_field(self, value, conversion):
278 # do any conversion on the resulting object
279 if conversion is None:
280 return value
281 elif conversion == 's':
282 return str(value)
283 elif conversion == 'r':
284 return repr(value)
285 elif conversion == 'a':
286 return ascii(value)
287 raise ValueError("Unknown conversion specifier {0!s}".format(conversion))
288
289 def parse(self, format_string):
290 """

Callers 1

_vformatMethod · 0.95

Calls 3

strFunction · 0.85
asciiFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected