MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / convert_field

Method convert_field

tools/python-3.11.9-amd64/Lib/string.py:267–277  ·  view source on GitHub ↗
(self, value, conversion)

Source from the content-addressed store, hash-verified

265
266
267 def convert_field(self, value, conversion):
268 # do any conversion on the resulting object
269 if conversion is None:
270 return value
271 elif conversion == 's':
272 return str(value)
273 elif conversion == 'r':
274 return repr(value)
275 elif conversion == 'a':
276 return ascii(value)
277 raise ValueError("Unknown conversion specifier {0!s}".format(conversion))
278
279
280 # returns an iterable that contains tuples of the form:

Callers 1

_vformatMethod · 0.95

Calls 3

strFunction · 0.85
asciiFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected