Improve asuswrt decorator typing (#116563)

This commit is contained in:
Marc Mueller 2024-05-02 00:00:30 +02:00 committed by GitHub
parent aa1af37d1b
commit 86f96db9b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,10 +66,12 @@ _ReturnFuncType = Callable[[_AsusWrtBridgeT], Coroutine[Any, Any, dict[str, Any]
def handle_errors_and_zip(
exceptions: type[Exception] | tuple[type[Exception], ...], keys: list[str] | None
) -> Callable[[_FuncType], _ReturnFuncType]:
) -> Callable[[_FuncType[_AsusWrtBridgeT]], _ReturnFuncType[_AsusWrtBridgeT]]:
"""Run library methods and zip results or manage exceptions."""
def _handle_errors_and_zip(func: _FuncType) -> _ReturnFuncType:
def _handle_errors_and_zip(
func: _FuncType[_AsusWrtBridgeT],
) -> _ReturnFuncType[_AsusWrtBridgeT]:
"""Run library methods and zip results or manage exceptions."""
@functools.wraps(func)