diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-16 12:07:25 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-17 09:42:29 -0400 |
commit | 3b520e758a715cf817075e4a90ae1b5813ffadd3 (patch) | |
tree | 260f9517af499e7fb789d188f1631cd823a59929 /lib/sqlalchemy/orm/attributes.py | |
parent | 6acf5d2fca4a988a77481b82662174e8015a6b37 (diff) | |
download | sqlalchemy-3b520e758a715cf817075e4a90ae1b5813ffadd3.tar.gz |
pep484 for hybrid
Change-Id: I53274b13094d996e11b04acb03f9613edbddf87f
References: #6810
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index ce3a645ad..2b6ca400e 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -20,6 +20,7 @@ from collections import namedtuple import operator import typing from typing import Any +from typing import Callable from typing import List from typing import NamedTuple from typing import Tuple @@ -68,6 +69,7 @@ from ..sql import visitors if typing.TYPE_CHECKING: from ..sql.elements import ColumnElement + from ..sql.elements import SQLCoreOperations _T = TypeVar("_T") @@ -277,7 +279,9 @@ class QueryableAttribute( def _from_objects(self): return self.expression._from_objects - def _bulk_update_tuples(self, value): + def _bulk_update_tuples( + self, value: Any + ) -> List[Tuple[SQLCoreOperations[_T], Any]]: """Return setter tuples for a bulk UPDATE.""" return self.comparator._bulk_update_tuples(value) @@ -416,7 +420,9 @@ HasEntityNamespace = namedtuple("HasEntityNamespace", ["entity_namespace"]) HasEntityNamespace.is_mapper = HasEntityNamespace.is_aliased_class = False -def create_proxied_attribute(descriptor): +def create_proxied_attribute( + descriptor: Any, +) -> Callable[..., QueryableAttribute[Any]]: """Create an QueryableAttribute / user descriptor hybrid. Returns a new QueryableAttribute type that delegates descriptor |