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

Function test_tokenize_callable_class_with_tokenize_method

dask/tests/test_tokenize.py:779–794  ·  view source on GitHub ↗

Always use ___dask_tokenize__ if present

()

Source from the content-addressed store, hash-verified

777
778
779def test_tokenize_callable_class_with_tokenize_method():
780 """Always use ___dask_tokenize__ if present"""
781
782 class C:
783 def __init__(self, x, y):
784 self.x = x
785 self.y = y
786
787 def __dask_tokenize__(self):
788 return self.x
789
790 def __call__(self):
791 pass
792
793 assert check_tokenize(C(1, 2)) == check_tokenize(C(1, 3))
794 assert check_tokenize(C(1, 2)) != check_tokenize(C(2, 2))
795
796
797class HasStaticMethods:

Callers

nothing calls this directly

Calls 2

check_tokenizeFunction · 0.85
CClass · 0.70

Tested by

no test coverage detected