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

Method __setstate__

Lib/test/test_descr.py:3879–3881  ·  view source on GitHub ↗
(self_, lst)

Source from the content-addressed store, hash-verified

3877 def __getstate__(self):
3878 return [self.foo]
3879 def __setstate__(self_, lst):
3880 self.assertEqual(len(lst), 1)
3881 self_.__foo = self_.foo = lst[0]
3882 a = C(42)
3883 a.setfoo(24)
3884 self.assertEqual(a.foo, 24)

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected