MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/sql/elements.py:3933–3962  ·  view source on GitHub ↗
(
        self,
        left: ColumnElement[Any],
        right: ColumnElement[Any],
        operator: OperatorType,
        type_: Optional[_TypeEngineArgument[_T]] = None,
        negate: Optional[OperatorType] = None,
        modifiers: Optional[Mapping[str, Any]] = None,
    )

Source from the content-addressed store, hash-verified

3931 modifiers: Mapping[str, Any]
3932
3933 def __init__(
3934 self,
3935 left: ColumnElement[Any],
3936 right: ColumnElement[Any],
3937 operator: OperatorType,
3938 type_: Optional[_TypeEngineArgument[_T]] = None,
3939 negate: Optional[OperatorType] = None,
3940 modifiers: Optional[Mapping[str, Any]] = None,
3941 ):
3942 # allow compatibility with libraries that
3943 # refer to BinaryExpression directly and pass strings
3944 if isinstance(operator, str):
3945 operator = operators.custom_op(operator)
3946 self._orig = (left.__hash__(), right.__hash__())
3947 self._propagate_attrs = left._propagate_attrs or right._propagate_attrs
3948 self.left = left.self_group(against=operator)
3949 self.right = right.self_group(against=operator)
3950 self.operator = operator
3951
3952 # if type is None, we get NULLTYPE, which is our _T. But I don't
3953 # know how to get the overloads to express that correctly
3954 self.type = type_api.to_instance(type_) # type: ignore
3955
3956 self.negate = negate
3957 self._is_implicitly_boolean = operators.is_boolean(operator)
3958
3959 if modifiers is None:
3960 self.modifiers = {}
3961 else:
3962 self.modifiers = modifiers
3963
3964 @property
3965 def _flattened_operator_clauses(

Callers

nothing calls this directly

Calls 2

__hash__Method · 0.45
self_groupMethod · 0.45

Tested by

no test coverage detected