We're currently assigning delay as the attribute of func here, which results in the type of func.delay being Any.
To improve type safety, we should instead:
- define a new class (called
TaskDefinition?) with proper type annotations for delay, __call__ (etc.)
- wrap
func in an instance of that new class (wrapped = TaskDefinition(self, func))
We're currently assigning
delayas the attribute offunchere, which results in the type offunc.delaybeingAny.To improve type safety, we should instead:
TaskDefinition?) with proper type annotations fordelay,__call__(etc.)funcin an instance of that new class (wrapped = TaskDefinition(self, func))