MCPcopy
hub / github.com/dask/dask / SizeOf

Class SizeOf

dask/tests/test_task_spec.py:697–712  ·  view source on GitHub ↗

An object that returns exactly nbytes when inspected by dask.sizeof.sizeof

Source from the content-addressed store, hash-verified

695
696
697class SizeOf:
698 """
699 An object that returns exactly nbytes when inspected by dask.sizeof.sizeof
700 """
701
702 def __init__(self, nbytes: int) -> None:
703 if not isinstance(nbytes, int):
704 raise TypeError(f"Expected integer for nbytes but got {type(nbytes)}")
705 if nbytes < _size_obj:
706 raise ValueError(
707 f"Expected a value larger than {_size_obj} integer but got {nbytes}."
708 )
709 self._nbytes = nbytes - _size_obj
710
711 def __sizeof__(self) -> int:
712 return self._nbytes
713
714
715def test_sizeof():

Callers 1

test_sizeofFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_sizeofFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…