summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorMartijn Pieters <mj@zopatista.com>2023-04-17 19:24:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2023-04-18 11:38:13 -0400
commitceec98e1d4d24389b10b3a26a693e94ddb70d65e (patch)
treed22583b2a19440d67230d2f6ac1c028f74115621 /lib/sqlalchemy/sql/elements.py
parent0112b3e2dc15f115f4b560bfc761e00fe1d4de24 (diff)
downloadsqlalchemy-ceec98e1d4d24389b10b3a26a693e94ddb70d65e.tar.gz
Define type hints for remaining column operators
Added typing information for recently added operators :meth:`.ColumnOperators.icontains`, :meth:`.ColumnOperators.istartswith`, :meth:`.ColumnOperators.iendswith`, and bitwise operators :meth:`.ColumnOperators.bitwise_and`, :meth:`.ColumnOperators.bitwise_or`, :meth:`.ColumnOperators.bitwise_xor`, :meth:`.ColumnOperators.bitwise_not`, :meth:`.ColumnOperators.bitwise_lshift` :meth:`.ColumnOperators.bitwise_rshift`. Pull request courtesy Martijn Pieters. Fixes: #9650 Closes: #9652 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9652 Pull-request-sha: 005c56848af8cff6bb19f71541873027f141eb6e Change-Id: I2fa06eb42ce668df9d9c760d233906f87484dd12
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 0f356ae27..b32201c7f 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -833,6 +833,12 @@ class SQLCoreOperations(Generic[_T], ColumnOperators, TypingOnly):
def __getitem__(self, index: Any) -> ColumnElement[Any]:
...
+ def __lshift__(self, other: Any) -> ColumnElement[Any]:
+ ...
+
+ def __rshift__(self, other: Any) -> ColumnElement[Any]:
+ ...
+
@overload
def concat(self: _SQO[str], other: Any) -> ColumnElement[str]:
...
@@ -854,6 +860,24 @@ class SQLCoreOperations(Generic[_T], ColumnOperators, TypingOnly):
) -> BinaryExpression[bool]:
...
+ def bitwise_xor(self, other: Any) -> BinaryExpression[Any]:
+ ...
+
+ def bitwise_or(self, other: Any) -> BinaryExpression[Any]:
+ ...
+
+ def bitwise_and(self, other: Any) -> BinaryExpression[Any]:
+ ...
+
+ def bitwise_not(self) -> UnaryExpression[_T]:
+ ...
+
+ def bitwise_lshift(self, other: Any) -> BinaryExpression[Any]:
+ ...
+
+ def bitwise_rshift(self, other: Any) -> BinaryExpression[Any]:
+ ...
+
def in_(
self,
other: Union[
@@ -915,6 +939,14 @@ class SQLCoreOperations(Generic[_T], ColumnOperators, TypingOnly):
) -> ColumnElement[bool]:
...
+ def istartswith(
+ self,
+ other: Any,
+ escape: Optional[str] = None,
+ autoescape: bool = False,
+ ) -> ColumnElement[bool]:
+ ...
+
def endswith(
self,
other: Any,
@@ -923,9 +955,20 @@ class SQLCoreOperations(Generic[_T], ColumnOperators, TypingOnly):
) -> ColumnElement[bool]:
...
+ def iendswith(
+ self,
+ other: Any,
+ escape: Optional[str] = None,
+ autoescape: bool = False,
+ ) -> ColumnElement[bool]:
+ ...
+
def contains(self, other: Any, **kw: Any) -> ColumnElement[bool]:
...
+ def icontains(self, other: Any, **kw: Any) -> ColumnElement[bool]:
+ ...
+
def match(self, other: Any, **kwargs: Any) -> ColumnElement[bool]:
...