Josh
02/09/2021, 4:31 PMrun
methods allowed to return arbitrary objects?
class ReturnObject:
def__init__(self, value: str = "hello", list: List = ["world"]):
self.value = value
self.list = list
class MyTask(Task):
def run(self) -> ReturnObject:
return ReturnObject("some value", ["a", "b", "c"])
task = MyTask()
with Flow() as flow:
result = task()
some_other_task(param1=result.value, param2=result.list)
If I try to run this code, I’ll get an error like
AttributeError: 'MyTask' object has no attribute 'value'
Chris White
some_other_task