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

Method loads

Lib/test/pickletester.py:1297–1301  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

1295
1296 def test_custom_find_class(self):
1297 def loads(data):
1298 class Unpickler(self.unpickler):
1299 def find_class(self, module_name, global_name):
1300 return (module_name, global_name)
1301 return Unpickler(io.BytesIO(data)).load()
1302
1303 self.assertEqual(loads(b'cmath\nlog\n.'), ('math', 'log'))
1304 self.assertEqual(loads(b'\x8c\x04math\x8c\x03log\x93.'), ('math', 'log'))

Calls 2

UnpicklerClass · 0.85
loadMethod · 0.45

Tested by

no test coverage detected