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

Method decode

Lib/json/decoder.py:354–363  ·  view source on GitHub ↗

Return the Python representation of ``s`` (a ``str`` instance containing a JSON document).

(self, s, _w=WHITESPACE.match)

Source from the content-addressed store, hash-verified

352
353
354 def decode(self, s, _w=WHITESPACE.match):
355 """Return the Python representation of ``s`` (a ``str`` instance
356 containing a JSON document).
357
358 """
359 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
360 end = _w(s, end).end()
361 if end != len(s):
362 raise JSONDecodeError("Extra data", s, end)
363 return obj
364
365 def raw_decode(self, s, idx=0):
366 """Decode a JSON document from ``s`` (a ``str`` beginning with

Callers 1

loadsFunction · 0.45

Calls 4

raw_decodeMethod · 0.95
lenFunction · 0.85
JSONDecodeErrorClass · 0.85
endMethod · 0.45

Tested by

no test coverage detected