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

Method __new__

dask/_expr.py:885–894  ·  view source on GitHub ↗
(cls, *args, _determ_token=None, **kwargs)

Source from the content-addressed store, hash-verified

883 _instances: weakref.WeakValueDictionary[str, SingletonExpr]
884
885 def __new__(cls, *args, _determ_token=None, **kwargs):
886 if not hasattr(cls, "_instances"):
887 cls._instances = weakref.WeakValueDictionary()
888 inst = super().__new__(cls, *args, _determ_token=_determ_token, **kwargs)
889 _name = inst._name
890 if _name in cls._instances and cls.__init__ == object.__init__:
891 return cls._instances[_name]
892
893 cls._instances[_name] = inst
894 return inst
895
896
897def collect_dependents(expr) -> defaultdict:

Callers

nothing calls this directly

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected