MCPcopy Index your code
hub / github.com/RustPython/RustPython / dumps

Method dumps

Lib/xmlrpc/client.py:467–492  ·  view source on GitHub ↗
(self, values)

Source from the content-addressed store, hash-verified

465 dispatch = {}
466
467 def dumps(self, values):
468 out = []
469 write = out.append
470 dump = self.__dump
471 if isinstance(values, Fault):
472 # fault instance
473 write("<fault>\n")
474 dump({'faultCode': values.faultCode,
475 'faultString': values.faultString},
476 write)
477 write("</fault>\n")
478 else:
479 # parameter block
480 # FIXME: the xml-rpc specification allows us to leave out
481 # the entire <params> block if there are no parameters.
482 # however, changing this may break older code (including
483 # old versions of xmlrpclib.py), so this is better left as
484 # is for now. See @XMLRPC3 for more information. /F
485 write("<params>\n")
486 for v in values:
487 write("<param>\n")
488 dump(v, write)
489 write("</param>\n")
490 write("</params>\n")
491 result = "".join(out)
492 return result
493
494 def __dump(self, value, write):
495 try:

Callers 15

dumpsFunction · 0.95
makePickleMethod · 0.45
mainFunction · 0.45
_code_to_timestamp_pycFunction · 0.45
_code_to_hash_pycFunction · 0.45
round_trip_testFunction · 0.45
stdlib_json.pyFile · 0.45
dump_then_loadMethod · 0.45
test_roundtripMethod · 0.45
compareFunction · 0.45

Calls 4

isinstanceFunction · 0.85
writeFunction · 0.50
dumpFunction · 0.50
joinMethod · 0.45

Tested by 2

test_roundtripMethod · 0.36
replace_compiledFunction · 0.36