Return the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document)
(self, s, _w=WHITESPACE.match)
| 395 | self.scan_once = make_scanner(self) |
| 396 | |
| 397 | def decode(self, s, _w=WHITESPACE.match): |
| 398 | """Return the Python representation of ``s`` (a ``str`` or ``unicode`` |
| 399 | instance containing a JSON document) |
| 400 | |
| 401 | """ |
| 402 | obj, end = self.raw_decode(s, idx=_w(s, 0).end()) |
| 403 | end = _w(s, end).end() |
| 404 | if end != len(s): |
| 405 | raise JSONDecodeError("Extra data", s, end, len(s)) |
| 406 | return obj |
| 407 | |
| 408 | def raw_decode(self, s, idx=0): |
| 409 | """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` |
no test coverage detected