Skip to content

Commit

Permalink
fix: shift type definitions to stub file
Browse files Browse the repository at this point in the history
- typing uses ParamSpec whis is supported for Python 3.10+
  • Loading branch information
aleneum committed Jun 11, 2024
1 parent a24d1f4 commit 17b4ca1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 1 addition & 6 deletions transitions/experimental/decoration.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions transitions/experimental/decoration.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Callable, ParamSpec

P = ParamSpec("P")


def expect_override(func: Callable[P, bool | None]) -> Callable[P, bool | None]: ...

0 comments on commit 17b4ca1

Please sign in to comment.