MCPcopy Create free account
hub / github.com/dask/dask / __getstate__

Method __getstate__

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

Source from the content-addressed store, hash-verified

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