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:780–795  ·  view source on GitHub ↗

Always use ___dask_tokenize__ if present

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

check_tokenizeFunction · 0.85
CClass · 0.70

Tested by

no test coverage detected