Are class methods pure in dask?
Are class methods pure in dask? Is this a valid use of pure in Dask? pure Lets assume that bar is never changed during the computation, but it may change while I setup the computation. bar from dask import delayed class a: def __init__(self): self.bar = 1 def foo(self, b): return self.bar + b def dask_foo(self, b): return delayed(self.foo, pure=True)(b) 1 Answer 1 Yes, this is valid use: you are effectively asserting that the bar attribute, which is not an argument to the delayed function, will not change for any subsequent calls. When you say something is "pure", then Dask assumes that calling with argument b=5 will get the same result each time. Notice that if you call dask_foo with the same value of b multiple times, the key of the resulting delayed object will be the same every time. If you have pure=False , you get a random UUID part to the ke...