Ah, good idea. With ParamSpec, we should be able to have full specification.
Sadly, we can't yet use PEP 695 syntax because we need to support older python, but we can use the most modern syntax that is supported with from __future__ import annotations so feel free :)
The task decorator is annotated to return
Any
. This makes it harder to discover the API as no autocomplete and type check is offered by the editor.Fortunately, the function description and the overall documentation make up quite well for it.
I think it would still be nice to get improved type annotations for the decorator.
If this is something you are interested in, I can offer to contribute.