The decorators are a bit more complex here than in state.py, so we need a slightly more complicated hint.
Ideally, we would be able to use Callable[Concatenate[HasConfig, P], R] and not have to fish the HasConfig out of args, but there are some complicated issues with wrapped functions (see https://github.com/python/typeshed/issues/10653 for more context):
error: Incompatible return value type (got "_Wrapped[[HasConfig, **P], R, [HasConfig, **P], R]", expected "Callable[[HasConfig, **P], R]") [return-value]
The decorators are a bit more complex here than in state.py, so we need a slightly more complicated hint.
Ideally, we would be able to use
Callable[Concatenate[HasConfig, P], R]
and not have to fish theHasConfig
out ofargs
, but there are some complicated issues with wrapped functions (see https://github.com/python/typeshed/issues/10653 for more context):