_O = TypeVar("_O", bound=object)
_TE = TypeVar("_TE", bound="TypeEngine[Any]")
_CT = TypeVar("_CT", bound=Any)
+_RT = TypeVar("_RT", bound=Any)
_MatchedOnType = Union[
"GenericProtocol[Any]", TypeAliasType, NewType, Type[Any]
def __reduce__(self) -> Any:
return self.__class__, (self.expr,)
+ @overload
+ def operate(
+ self,
+ op: OperatorType,
+ *other: Any,
+ result_type: Type[TypeEngine[_RT]],
+ **kwargs: Any,
+ ) -> ColumnElement[_RT]: ...
+
+ @overload
+ def operate(
+ self, op: OperatorType, *other: Any, **kwargs: Any
+ ) -> ColumnElement[_CT]: ...
+
@util.preload_module("sqlalchemy.sql.default_comparator")
def operate(
self, op: OperatorType, *other: Any, **kwargs: Any
- ) -> ColumnElement[_CT]:
+ ) -> ColumnElement[Any]:
default_comparator = util.preloaded.sql_default_comparator
op_fn, addtl_kw = default_comparator.operator_lookup[op.__name__]
if kwargs: