summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/operators.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-02-27 23:05:46 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-03-01 21:05:14 -0500
commitafb9634fb28b00c7b0979660e3e0bfed6caafde5 (patch)
tree11afb462226f64d922f9d3c425a7d2c09c3d69d7 /lib/sqlalchemy/sql/operators.py
parent7f1a3f22abffc1529100e14fcfd07a46a49fd44f (diff)
downloadsqlalchemy-afb9634fb28b00c7b0979660e3e0bfed6caafde5.tar.gz
pep484 + abc bases for assocaitionproxy
went to this one next as it was going to be hard, and also exercises the ORM expression hierarchy a bit. made some adjustments to SQLCoreOperations etc. Change-Id: Ie5dde9218dc1318252826b766d3e70b17dd24ea7 References: #6810 References: #7774
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r--lib/sqlalchemy/sql/operators.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py
index d4fa8042d..f08e71bcd 100644
--- a/lib/sqlalchemy/sql/operators.py
+++ b/lib/sqlalchemy/sql/operators.py
@@ -179,10 +179,10 @@ class Operators(Generic[_OP_RETURN]):
precedence: int = 0,
is_comparison: bool = False,
return_type: Optional[
- Union[Type["TypeEngine[_T]"], "TypeEngine[_T]"]
+ Union[Type["TypeEngine[Any]"], "TypeEngine[Any]"]
] = None,
python_impl=None,
- ) -> Callable[[Any], _OP_RETURN]:
+ ) -> Callable[[Any], Any]:
"""Produce a generic operator function.
e.g.::
@@ -270,7 +270,7 @@ class Operators(Generic[_OP_RETURN]):
def bool_op(
self, opstring: Any, precedence: int = 0, python_impl=None
- ) -> Callable[[Any], _OP_RETURN]:
+ ) -> Callable[[Any], Any]:
"""Return a custom boolean operator.
This method is shorthand for calling
@@ -1021,9 +1021,7 @@ class ColumnOperators(Operators[_OP_RETURN]):
endswith_op, other, escape=escape, autoescape=autoescape
)
- def contains(
- self, other: Any, escape=None, autoescape=False
- ) -> "ColumnOperators":
+ def contains(self, other: Any, **kw: Any) -> "ColumnOperators":
r"""Implement the 'contains' operator.
Produces a LIKE expression that tests against a match for the middle
@@ -1101,9 +1099,7 @@ class ColumnOperators(Operators[_OP_RETURN]):
"""
- return self.operate(
- contains_op, other, escape=escape, autoescape=autoescape
- )
+ return self.operate(contains_op, other, **kw)
def match(self, other: Any, **kwargs) -> "ColumnOperators":
"""Implements a database-specific 'match' operator.