MCPcopy
hub / github.com/dask/dask / __len__

Method __len__

dask/highlevelgraph.py:553–559  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

551 raise KeyError(key)
552
553 def __len__(self) -> int:
554 # NOTE: this will double-count keys that are duplicated between layers, so it's
555 # possible that `len(hlg) > len(hlg.to_dict())`. However, duplicate keys should
556 # not occur through normal use, and their existence would usually be a bug.
557 # So we ignore this case in favor of better performance.
558 # https://github.com/dask/dask/issues/7271
559 return sum(len(layer) for layer in self.layers.values())
560
561 def __iter__(self) -> Iterator[Key]:
562 return iter(self.to_dict())

Callers

nothing calls this directly

Calls 2

sumFunction · 0.50
valuesMethod · 0.45

Tested by

no test coverage detected