diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-13 13:37:11 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-15 21:38:29 -0400 |
commit | 6acf5d2fca4a988a77481b82662174e8015a6b37 (patch) | |
tree | 73e2868a51b8b7ac46d7b3b7f9562c1d011f6e1b /lib/sqlalchemy/orm/attributes.py | |
parent | 35f82173e04b3209e07fcfc0606a7614108d018e (diff) | |
download | sqlalchemy-6acf5d2fca4a988a77481b82662174e8015a6b37.tar.gz |
pep-484 - SQL column operations
note we are taking out the
ColumnOperartors[SQLCoreOperations] thing; not really clear
why that was needed and at the moment it seems I was likely
confused.
Change-Id: I834b75f9b44f91b97e29f2e1a7b1029bd910e0a1
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index c4afdb3a9..ce3a645ad 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -18,6 +18,7 @@ from __future__ import annotations from collections import namedtuple import operator +import typing from typing import Any from typing import List from typing import NamedTuple @@ -65,6 +66,9 @@ from ..sql import roles from ..sql import traversals from ..sql import visitors +if typing.TYPE_CHECKING: + from ..sql.elements import ColumnElement + _T = TypeVar("_T") @@ -84,6 +88,7 @@ class QueryableAttribute( roles.JoinTargetRole, roles.OnClauseRole, roles.ColumnsClauseRole, + roles.ExpressionElementRole[_T], sql_base.Immutable, sql_base.MemoizedHasCacheKey, ): @@ -265,7 +270,7 @@ class QueryableAttribute( def _annotations(self): return self.__clause_element__()._annotations - def __clause_element__(self): + def __clause_element__(self) -> ColumnElement[_T]: return self.expression @property |