summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/state_changes.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/state_changes.py')
-rw-r--r--lib/sqlalchemy/orm/state_changes.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/state_changes.py b/lib/sqlalchemy/orm/state_changes.py
index 1afeab05b..b7bf96558 100644
--- a/lib/sqlalchemy/orm/state_changes.py
+++ b/lib/sqlalchemy/orm/state_changes.py
@@ -16,12 +16,15 @@ from typing import Any
from typing import Callable
from typing import Optional
from typing import Tuple
+from typing import TypeVar
from typing import Union
from .. import exc as sa_exc
from .. import util
from ..util.typing import Literal
+_F = TypeVar("_F", bound=Callable[..., Any])
+
class _StateChangeState(Enum):
pass
@@ -60,7 +63,7 @@ class _StateChange:
Literal[_StateChangeStates.ANY], Tuple[_StateChangeState, ...]
],
moves_to: _StateChangeState,
- ) -> Callable[..., Any]:
+ ) -> Callable[[_F], _F]:
"""Method decorator declaring valid states.
:param prerequisite_states: sequence of acceptable prerequisite