While converting my program using delayed, I stumbled upon a commonly used programming pattern that doesn't work with delayed. Example:
from dask import delayed
@delayed
def myFunction():
return 1,2
a, b = myFunction()
a.compute()
Raises: TypeError: Delayed objects of unspecified length are not iterable
While the following work around does not. But looks a lot more clumsy
from dask import delayed
@delayed
def myFunction():
return 1,2
dummy = myFunction()
a, b = dummy[0], dummy[1]
a.compute()
Is this the intended behaviour?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…