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

Method __getstate__

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

Source from the content-addressed store, hash-verified

848 )
849
850 def __getstate__(self):
851 state = super().__getstate__()
852 state = list(state)
853 slots = self.__class__.get_all_slots()
854 ix = slots.index("kwargs")
855 # The constructor as a kwarg is redundant since this is encoded in the
856 # class itself. Serializing the builtin types is not trivial
857 # This saves about 15% of overhead
858 state[ix] = state[ix].copy()
859 state[ix].pop("constructor", None)
860 return state
861
862 def __setstate__(self, state):
863 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