diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-04-07 12:37:23 -0400 |
---|---|---|
committer | mike bayer <mike_mp@zzzcomputing.com> | 2022-04-12 02:09:50 +0000 |
commit | aa9cd878e8249a4a758c7f968e929e92fede42a5 (patch) | |
tree | 1be1c9dc24dd247a150be55d65bfc56ebaf111bc /lib/sqlalchemy/orm/state_changes.py | |
parent | 98eae4e181cb2d1bbc67ec834bfad29dcba7f461 (diff) | |
download | sqlalchemy-aa9cd878e8249a4a758c7f968e929e92fede42a5.tar.gz |
pep-484: session, instancestate, etc
Also adds some fixes to annotation-based mapping
that have come up, as well as starts to add more
pep-484 test cases
Change-Id: Ia722bbbc7967a11b23b66c8084eb61df9d233fee
Diffstat (limited to 'lib/sqlalchemy/orm/state_changes.py')
-rw-r--r-- | lib/sqlalchemy/orm/state_changes.py | 5 |
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 |