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

Method _decode_string

Lib/pickle.py:1435–1442  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

1433 dispatch[BINFLOAT[0]] = load_binfloat
1434
1435 def _decode_string(self, value):
1436 # Used to allow strings from Python 2 to be decoded either as
1437 # bytes or Unicode strings. This should be used only with the
1438 # STRING, BINSTRING and SHORT_BINSTRING opcodes.
1439 if self.encoding == "bytes":
1440 return value
1441 else:
1442 return value.decode(self.encoding, self.errors)
1443
1444 def load_string(self):
1445 data = self.readline()[:-1]

Callers 3

load_stringMethod · 0.95
load_binstringMethod · 0.95
load_short_binstringMethod · 0.95

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected