Always use ___dask_tokenize__ if present
()
| 778 | |
| 779 | |
| 780 | def 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 | |
| 798 | class HasStaticMethods: |
nothing calls this directly
no test coverage detected