I tried adding it to a subscriber/publisher method but that crashed; _, task_info = self._tasks[func.__name__] doesn't work because self._tasks[func.__name__] is a single function, not a tuple. And the function doesn't have an .address so it can't be used for the fstring in the log call anyway.
If I fix the above, then the function returns immediately because it's actually returning the generator method it's wrapping.
That makes me think that it's only intended to be used in a standalone function / method that isn't called by the framework, but then I can't consolidate why it has setattr(func, TIMEIT_ATTR, True).
I'll make a separate wrapper for my own uses.
I tried adding it to a subscriber/publisher method but that crashed;
_, task_info = self._tasks[func.__name__]doesn't work becauseself._tasks[func.__name__]is a single function, not a tuple. And the function doesn't have an.addressso it can't be used for the fstring in the log call anyway.If I fix the above, then the function returns immediately because it's actually returning the generator method it's wrapping.
That makes me think that it's only intended to be used in a standalone function / method that isn't called by the framework, but then I can't consolidate why it has
setattr(func, TIMEIT_ATTR, True).I'll make a separate wrapper for my own uses.