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

Function getparser

Lib/xmlrpc/client.py:879–903  ·  view source on GitHub ↗

getparser() -> parser, unmarshaller Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects.

(use_datetime=False, use_builtin_types=False)

Source from the content-addressed store, hash-verified

877# return A (parser, unmarshaller) tuple.
878
879def getparser(use_datetime=False, use_builtin_types=False):
880 """getparser() -> parser, unmarshaller
881
882 Create an instance of the fastest available parser, and attach it
883 to an unmarshalling object. Return both objects.
884 """
885 if FastParser and FastUnmarshaller:
886 if use_builtin_types:
887 mkdatetime = _datetime_type
888 mkbytes = base64.decodebytes
889 elif use_datetime:
890 mkdatetime = _datetime_type
891 mkbytes = _binary
892 else:
893 mkdatetime = _datetime
894 mkbytes = _binary
895 target = FastUnmarshaller(True, False, mkbytes, mkdatetime, Fault)
896 parser = FastParser(target)
897 else:
898 target = Unmarshaller(use_datetime=use_datetime, use_builtin_types=use_builtin_types)
899 if FastParser:
900 parser = FastParser(target)
901 else:
902 parser = ExpatParser(target)
903 return parser, target
904
905##
906# Convert a Python tuple or a Fault instance to an XML-RPC packet.

Callers 2

loadsFunction · 0.85
getparserMethod · 0.85

Calls 2

UnmarshallerClass · 0.85
ExpatParserClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…