micropython-stubs icon indicating copy to clipboard operation
micropython-stubs copied to clipboard

improve the typing for emitter decorators @native @viper etc

Open Josverl opened this issue 8 months ago • 0 comments

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."""
    ...

Josverl avatar Feb 06 '25 00:02 Josverl