MCPcopy
hub / github.com/dask/dask / __getstate__

Method __getstate__

dask/_task_spec.py:862–872  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

860 )
861
862 def __getstate__(self):
863 state = super().__getstate__()
864 state = list(state)
865 slots = self.__class__.get_all_slots()
866 ix = slots.index("kwargs")
867 # The constructor as a kwarg is redundant since this is encoded in the
868 # class itself. Serializing the builtin types is not trivial
869 # This saves about 15% of overhead
870 state[ix] = state[ix].copy()
871 state[ix].pop("constructor", None)
872 return state
873
874 def __setstate__(self, state):
875 super().__setstate__(state)

Callers

nothing calls this directly

Calls 5

get_all_slotsMethod · 0.80
popMethod · 0.80
__getstate__Method · 0.45
indexMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected