summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 748e9504b..f9c7cac23 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -582,7 +582,9 @@ class ClauseElement(
"""
return traversals.compare(self, other, **kw)
- def self_group(self, against: Optional[OperatorType] = None) -> Any:
+ def self_group(
+ self, against: Optional[OperatorType] = None
+ ) -> ClauseElement:
"""Apply a 'grouping' to this :class:`_expression.ClauseElement`.
This method is overridden by subclasses to return a "grouping"
@@ -609,7 +611,7 @@ class ClauseElement(
"""
return self
- def _ungroup(self):
+ def _ungroup(self) -> ClauseElement:
"""Return this :class:`_expression.ClauseElement`
without any groupings.
"""
@@ -3452,6 +3454,8 @@ class UnaryExpression(ColumnElement[_T]):
("modifier", InternalTraversal.dp_operator),
]
+ element: ClauseElement
+
def __init__(
self,
element: ColumnElement[Any],