micropython-stubs
micropython-stubs copied to clipboard
improve the typing for emitter decorators @native @viper etc
from typing_extensions import ParamSpec, TypeVar
P = ParamSpec("P")
R = TypeVar("R")
def viper(_func: Callable[P, R], /) -> Callable[P, R]:
"""A type-safe decorator to add logging to a function."""
...