diff --git a/transitions/experimental/decoration.py b/transitions/experimental/decoration.py index bc305add..2a76e266 100644 --- a/transitions/experimental/decoration.py +++ b/transitions/experimental/decoration.py @@ -1,8 +1,3 @@ -from typing import Callable, ParamSpec - -P = ParamSpec("P") - - -def expect_override(func: Callable[P, bool | None]) -> Callable[P, bool | None]: +def expect_override(func): setattr(func, "expect_override", True) return func diff --git a/transitions/experimental/decoration.pyi b/transitions/experimental/decoration.pyi new file mode 100644 index 00000000..55945c60 --- /dev/null +++ b/transitions/experimental/decoration.pyi @@ -0,0 +1,6 @@ +from typing import Callable, ParamSpec + +P = ParamSpec("P") + + +def expect_override(func: Callable[P, bool | None]) -> Callable[P, bool | None]: ...