MCPcopy
hub / github.com/dask/dask / _HashIdWrapper

Class _HashIdWrapper

dask/utils.py:2064–2081  ·  view source on GitHub ↗

Hash and compare a wrapped object by identity instead of value

Source from the content-addressed store, hash-verified

2062
2063
2064class _HashIdWrapper:
2065 """Hash and compare a wrapped object by identity instead of value"""
2066
2067 def __init__(self, wrapped):
2068 self.wrapped = wrapped
2069
2070 def __eq__(self, other):
2071 if not isinstance(other, _HashIdWrapper):
2072 return NotImplemented
2073 return self.wrapped is other.wrapped
2074
2075 def __ne__(self, other):
2076 if not isinstance(other, _HashIdWrapper):
2077 return NotImplemented
2078 return self.wrapped is not other.wrapped
2079
2080 def __hash__(self):
2081 return id(self.wrapped)
2082
2083
2084@functools.lru_cache

Callers 2

cached_maxFunction · 0.85
cached_cumsumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…