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

Class _HashIdWrapper

dask/utils.py:2067–2084  ·  view source on GitHub ↗

Hash and compare a wrapped object by identity instead of value

Source from the content-addressed store, hash-verified

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

Callers 2

cached_maxFunction · 0.85
cached_cumsumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected