L i+(UdZddlmZddlmZddlmZddlmZ ddlm Z ddlm Z ddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlm Z!ddlm"Z#ddlm$Z%ddlm&Z'ddlm(Z)ddlm*Z+ddlm,Z-ddl.Z.ddl.m/Z/ddl.m0Z0ddl.m1Z1ddl.m2Z2ddl.m3Z3ddl.m4Z4ddl.m5Z5dd l.m6Z6dd!l.m7Z7dd"l.m8Z8dd#l.m9Z9dd$l.m:Z:dd%l.m;Z;d&d'lZ>d&d)l?m@Z@d&d*l?mAZAe.jrrd+d,lBmCZCd+d-lDmEZEd+d.lFmGZGd+d/lHmIZIe:d0e/1ZJe:d2e0d3e/f1ZKGd4d5eAZLe1eLeZe1eLe Ze1eLe Z e1eLe Z e1eLeZe1eLeZe1eLeZe1eLeZe1eLeZe1eLeZe1eLeZe1eLeZe1eLeZe1eLe!Z e1eLe#Z"e1eLe%Z$e1eLe'Z&e1eLe)Z(e1eLe+Z*e1eLe-Z,Gd6d7ZMGd8d9eLe3eJZNGd:d;eMZOe e"ee hZPd<dd?ZSdd@ZTddAZUeSddBZVeSeUddCZWeSddDZXeSddEZYeSddFZZe9r eSddGZ[neZZ[eSddHZ\e9r eSddIZ]ne\Z]eUeSddJZ^eUeSddKZ_e9r eSddLZ`ne_Z`eUeSddMZaeUeSddNZbe9r eSddOZcnebZceSddPZdeSddQZeeUeSdddRZfeUeSdddSZge9r eSdddTZhnegZheUeSdddUZieUeSdddVZje9r eSdddWZknejZkeUeSdddXZleUeSdddYZme9reS d ddZZnnemZneUeSdd[ZoeUeSdd\Zpe9r eSdd]ZqnepZqeSdd^ZreSdd_ZseSdd`Zt ddaZueUeS d ddbZveUeS d ddcZwe9reS d dddZxnewZxeUeS d ddeZyeUeS d ddfZzeUeS d ddgZ{eUeS d ddhZ|e9reS d ddiZ}ne|Z}eUeS d ddjZ~eUeS d ddkZeUeS d ddlZeUeS d ddmZe9reS d ddnZneZeUeS d ddoZeUeS d ddpZeUeSddqZeUeSdddrZeUeSdddsZeS d ddtZeUeSdduZe9r eSddvZneZeSddwZeSddxZeSddyZeSddzZeSdd{ZeSdd|Ze9r eSdd}ZneZeSdd~Ze9r eSddZneZeSddZeSddZeSddZeSddZeSddZeSddZeSddZeSddZddZddZddZddZeeZe\ee&fZddZeeeeeeeeiZddZePjIeee&gjKe e"gZddZddZeeeehZejIeeegZ eSddZGddeZieVdeWdesdetdededede de,dedede$dedede*dedediededededededededededeidejdefdegdeodepdeadiebde de"de^de_dededededeldemderdedeZde\dede&d&ededededdeXdeYdediZdeQd< ddZy)z*Defines operators used in SQL expressions.) annotations)IntEnum)add)and_)contains)eq)floordiv)ge)getitem)gt)inv)le)lshift)lt)mod)mul)ne)neg)or_)rshift)sub)truedivN)Any)Callable)cast)Dict)Generic)Optional)overload)Set)Tuple)Type) TYPE_CHECKING)TypeVar)Union)exc)util)Literal)Protocol)ColumnExpressionArgument) CacheConst) ColumnElement) TypeEngine_T)bound_FN.ceZdZUdZdZded<e d d dZe d d dZ d d dZy) OperatorTypezdescribe an op() function.str__name__NcyNr5selfleftrightotherkwargss ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sqlalchemy/sql/operators.py__call__zOperatorType.__call__I!cyr9r5r:s r@rAzOperatorType.__call__RrCcyr9r5r:s r@rAzOperatorType.__call__[s rCr9 r<zColumnExpressionArgument[Any]r= Optional[Any]r>rr?rreturnzColumnElement[Any] r< Operatorsr=rHr>rr?rrIrK r<rr=rHr>rr?rrIrK)r7 __module__ __qualname____doc__ __slots____annotations__rrAr5rCr@r4r4Bs$IM  $!+!! !  !  !! $      $     rCr4ceZdZdZdZd dZd dZd dZ d ddZ d ddZ dd Z e Z dd Z y)rKaBase of comparison and logical operators. Implements base methods :meth:`~sqlalchemy.sql.operators.Operators.operate` and :meth:`~sqlalchemy.sql.operators.Operators.reverse_operate`, as well as :meth:`~sqlalchemy.sql.operators.Operators.__and__`, :meth:`~sqlalchemy.sql.operators.Operators.__or__`, :meth:`~sqlalchemy.sql.operators.Operators.__invert__`. Usually is used via its most common subclass :class:`.ColumnOperators`. r5c.|jt|S)a.Implement the ``&`` operator. When used with SQL expressions, results in an AND operation, equivalent to :func:`_expression.and_`, that is:: a & b is equivalent to:: from sqlalchemy import and_ and_(a, b) Care should be taken when using ``&`` regarding operator precedence; the ``&`` operator has the highest precedence. The operands should be enclosed in parenthesis if they contain further sub expressions:: (a == 2) & (b == 4) )operaterr;r>s r@__and__zOperators.__and__s.||D%((rCc.|jt|S)a*Implement the ``|`` operator. When used with SQL expressions, results in an OR operation, equivalent to :func:`_expression.or_`, that is:: a | b is equivalent to:: from sqlalchemy import or_ or_(a, b) Care should be taken when using ``|`` regarding operator precedence; the ``|`` operator has the highest precedence. The operands should be enclosed in parenthesis if they contain further sub expressions:: (a == 2) | (b == 4) )rTrrUs r@__or__zOperators.__or__s.||C''rCc,|jtS)aImplement the ``~`` operator. When used with SQL expressions, results in a NOT operation, equivalent to :func:`_expression.not_`, that is:: ~a is equivalent to:: from sqlalchemy import not_ not_(a) )rTr r;s r@ __invert__zOperators.__invert__s ||C  rCNc8t|||||dfd }|S)a Produce a generic operator function. e.g.:: somecolumn.op("*")(5) produces:: somecolumn * 5 This function can also be used to make bitwise operators explicit. For example:: somecolumn.op("&")(0xFF) is a bitwise AND of the value in ``somecolumn``. :param opstring: a string which will be output as the infix operator between this element and the expression passed to the generated function. :param precedence: precedence which the database is expected to apply to the operator in SQL expressions. This integer value acts as a hint for the SQL compiler to know when explicit parenthesis should be rendered around a particular operation. A lower number will cause the expression to be parenthesized when applied against another operator with higher precedence. The default value of ``0`` is lower than all operators except for the comma (``,``) and ``AS`` operators. A value of 100 will be higher or equal to all operators, and -100 will be lower than or equal to all operators. .. seealso:: :ref:`faq_sql_expression_op_parenthesis` - detailed description of how the SQLAlchemy SQL compiler renders parenthesis :param is_comparison: legacy; if True, the operator will be considered as a "comparison" operator, that is which evaluates to a boolean true/false value, like ``==``, ``>``, etc. This flag is provided so that ORM relationships can establish that the operator is a comparison operator when used in a custom join condition. Using the ``is_comparison`` parameter is superseded by using the :meth:`.Operators.bool_op` method instead; this more succinct operator sets this parameter automatically, but also provides correct :pep:`484` typing support as the returned object will express a "boolean" datatype, i.e. ``BinaryExpression[bool]``. :param return_type: a :class:`.TypeEngine` class or object that will force the return type of an expression produced by this operator to be of that type. By default, operators that specify :paramref:`.Operators.op.is_comparison` will resolve to :class:`.Boolean`, and those that do not will be of the same type as the left-hand operand. :param python_impl: an optional Python function that can evaluate two Python values in the same way as this operator works when run on the database server. Useful for in-Python SQL expression evaluation functions, such as for ORM hybrid attributes, and the ORM "evaluator" used to match objects in a session after a multi-row update or delete. e.g.:: >>> expr = column("x").op("+", python_impl=lambda a, b: a + b)("y") The operator for the above expression will also work for non-SQL left and right objects:: >>> expr.operator(5, 10) 15 .. versionadded:: 2.0 .. seealso:: :meth:`.Operators.bool_op` :ref:`types_operators` :ref:`relationship_custom_operator` ) python_implc|Sr9r5)r>operatorr;s r@againstzOperators.op..against5sD%( (rCr>rrIrK) custom_op)r;opstring precedence is_comparison return_typer]r`r_s` @r@opz Operators.ops+|    #   )rCc,|j||d|S)aReturn a custom boolean operator. This method is shorthand for calling :meth:`.Operators.op` and passing the :paramref:`.Operators.op.is_comparison` flag with True. A key advantage to using :meth:`.Operators.bool_op` is that when using column constructs, the "boolean" nature of the returned expression will be present for :pep:`484` purposes. .. seealso:: :meth:`.Operators.op` T)rdrer]rg)r;rcrdr]s r@bool_opzOperators.bool_op:s&(ww !#   rCc*tt|)aGOperate on an argument. This is the lowest level of operation, raises :class:`NotImplementedError` by default. Overriding this on a subclass can allow common behavior to be applied to all operations. For example, overriding :class:`.ColumnOperators` to apply ``func.lower()`` to the left and right side:: class MyComparator(ColumnOperators): def operate(self, op, other, **kwargs): return op(func.lower(self), func.lower(other), **kwargs) :param op: Operator callable. :param \*other: the 'other' side of the operation. Will be a single scalar for most operations. :param \**kwargs: modifiers. These may be passed by special operators such as :meth:`ColumnOperators.contains`. NotImplementedErrorr6r;rgr>r?s r@rTzOperators.operateUs4"#b'**rCc *tt|)zXReverse operate on an argument. Usage is the same as :meth:`operate`. rlrns r@reverse_operatezOperators.reverse_operatess"#b'**rCra)rIrK)rFNN) rcr6rdintreboolrfz7Optional[Union[Type[TypeEngine[Any]], TypeEngine[Any]]]r]Optional[Callable[..., Any]]rICallable[[Any], Operators])rN)rcr6rdrqr]rsrIrt)rgr4r>rr?rrIrK) r7rMrNrOrPrVrXr[rgrjrT__sa_operate__rpr5rCr@rKrKzs I)2(2!*# 48iii i  i2i $i\48    2  $  6++(++7:+ +8N++'*+69+ +rCrKceZdZdZdZdZ d d dZd dZddZddZe d ddZ e d dd Z d dd Z y)rbaRepresent a 'custom' operator. :class:`.custom_op` is normally instantiated when the :meth:`.Operators.op` or :meth:`.Operators.bool_op` methods are used to create a custom operator callable. The class can also be used directly when programmatically constructing expressions. E.g. to represent the "factorial" operation:: from sqlalchemy.sql import UnaryExpression from sqlalchemy.sql import operators from sqlalchemy import Numeric unary = UnaryExpression( table.c.somecolumn, modifier=operators.custom_op("!"), type_=Numeric ) .. seealso:: :meth:`.Operators.op` :meth:`.Operators.bool_op` )rcrdrenatural_self_precedenteager_groupingrfr]Nc||_||_||_||_||_|r|j |nd|_||_yr9)rcrdrerwrx _to_instancerfr])r;rcrdrerfrwrxr]s r@__init__zcustom_op.__init__sN! $*&<#,5@K $ $[ 1d 'rCcht|txr!|j|jk(Sr9) isinstancerb _hash_keyrUs r@__eq__zcustom_op.__eq__s, ui ( 6!T^^%55 rCc4t|jSr9)hashr~rZs r@__hash__zcustom_op.__hash__sDNN$%%rCc|j|j|j|j|j|j |j r|j jfSdfSr9) __class__rcrdrerwrxrf_static_cache_keyrZs r@r~zcustom_op._hash_keysd NN MM OO     ' '   262B2BD   . .  IM  rCcyr9r5r:s r@rAzcustom_op.__call__rBrCcyr9r5r:s r@rAzcustom_op.__call__rErCct|dr|j||g|i|S|jr|j||g|i|Stjd|j d)NruzCustom operator zX can't be used with plain Python objects unless it includes the 'python_impl' parameter.)hasattrrTr]r'InvalidRequestErrorrcr:s r@rAzcustom_op.__call__s} 4) *4<<e>e>v> >   #4##D%B%B6B B))"4=="34++ rC)rFNFFN)rcr6rdrqrerrrfz5Optional[Union[Type[TypeEngine[_T]], TypeEngine[_T]]]rwrrrxrrr]rs)r>rrIrrrIrq)rIz"Union[CacheConst, Tuple[Any, ...]]r9rGrJrL) r7rMrNrOrPr{rrr~rrAr5rCr@rbrb~sO0HI# ',$48''' '  '!%''2', &   $!+!! !  !  !! $      $     rCrbceZdZUdZdZdZded< ejr dKdZ dKdZ dLdZ dLd Z erdMd Z n ejZ dLd ZdLd ZdLd ZdLdZerdLdZneZdLdZdLdZdNdZdLdZdOdZdLdZdLdZdLdZdLdZ dP dQdZ dP dQdZdLdZdLdZ dLdZ!dNdZ"dLdZ#dLd Z$dLd!Z%dLd"Z&erdLd#Z'ne&Z' dP dQd$Z(er dP dQd%Z)ne(Z) dP dQd&Z*er dP dQd'Z+ne*Z+dLd(Z,dLd)Z-erdLd*Z.ne-Z. dR dSd+Z/ dR dSd,Z0 dR dSd-Z1 dR dSd.Z2dTd/Z3dTd0Z4dUd1Z5 dP dVd2Z6 dP dWd3Z7dNd4Z8dNd5Z9dNd6Z:erdNd7Z;ne:Z;dNd8ZdLd;Z?dLd<Z@dLd=ZAdLd>ZB dY dZd?ZCdNd@ZDdNdAZEdNdBZFdLdCZGdLdDZHdLdEZIdLdFZJdLdGZKdLdHZLdLdIZMdLdJZNy)[ColumnOperatorsa"Defines boolean, comparison, and other operators for :class:`_expression.ColumnElement` expressions. By default, all methods call down to :meth:`.operate` or :meth:`.reverse_operate`, passing in the appropriate operator function from the Python builtin ``operator`` module or a SQLAlchemy-specific operator function from :mod:`sqlalchemy.expression.operators`. For example the ``__eq__`` function:: def __eq__(self, other): return self.operate(operators.eq, other) Where ``operators.eq`` is essentially:: def eq(a, b): return a == b The core column expression unit :class:`_expression.ColumnElement` overrides :meth:`.Operators.operate` and others to return further :class:`_expression.ColumnElement` constructs, so that the ``==`` operation above is replaced by a clause construct. .. seealso:: :ref:`types_operators` :attr:`.TypeEngine.comparator_factory` :class:`.ColumnOperators` :class:`.PropComparator` r5Nz Literal[None] timetuplecyr9r5rns r@rTzColumnOperators.operate!rCc yr9r5rns r@rpzColumnOperators.reverse_operate#rrCc.|jt|S)zdImplement the ``<`` operator. In a column context, produces the clause ``a < b``. )rTrrUs r@__lt__zColumnOperators.__lt__' ||B&&rCc.|jt|S)zfImplement the ``<=`` operator. In a column context, produces the clause ``a <= b``. )rTrrUs r@__le__zColumnOperators.__le__/rrCcyr9r5rZs r@rzColumnOperators.__hash__<rCc.|jt|S)zImplement the ``==`` operator. In a column context, produces the clause ``a = b``. If the target is ``None``, produces ``a IS NULL``. )rTrrUs r@rzColumnOperators.__eq__A||B&&rCc.|jt|S)zImplement the ``!=`` operator. In a column context, produces the clause ``a != b``. If the target is ``None``, produces ``a IS NOT NULL``. )rTrrUs r@__ne__zColumnOperators.__ne__JrrCc.|jt|S)zImplement the ``IS DISTINCT FROM`` operator. Renders "a IS DISTINCT FROM b" on most platforms; on some such as SQLite may render "a IS NOT b". )rTis_distinct_fromrUs r@rz ColumnOperators.is_distinct_fromSs||,e44rCc.|jt|S)aImplement the ``IS NOT DISTINCT FROM`` operator. Renders "a IS NOT DISTINCT FROM b" on most platforms; on some such as SQLite may render "a IS b". .. versionchanged:: 1.4 The ``is_not_distinct_from()`` operator is renamed from ``isnot_distinct_from()`` in previous releases. The previous name remains available for backwards compatibility. )rTis_not_distinct_fromrUs r@rz$ColumnOperators.is_not_distinct_from\s||0%88rCcyr9r5rUs r@isnot_distinct_fromz#ColumnOperators.isnot_distinct_fromlrrCc.|jt|S)zdImplement the ``>`` operator. In a column context, produces the clause ``a > b``. )rTr rUs r@__gt__zColumnOperators.__gt__qrrCc.|jt|S)zfImplement the ``>=`` operator. In a column context, produces the clause ``a >= b``. )rTr rUs r@__ge__zColumnOperators.__ge__yrrCc,|jtS)zaImplement the ``-`` operator. In a column context, produces the clause ``-a``. )rTrrZs r@__neg__zColumnOperators.__neg__s ||C  rCc.|jt|Sr9)rTrrUs r@ __contains__zColumnOperators.__contains__s||He,,rCc.|jt|S)zImplement the [] operator. This can be used by some database-specific types such as PostgreSQL ARRAY and HSTORE. )rTr )r;indexs r@ __getitem__zColumnOperators.__getitem__s||GU++rCc.|jt|S)zimplement the << operator. Not used by SQLAlchemy core, this is provided for custom operator systems which want to use << as an extension point. )rTrrUs r@ __lshift__zColumnOperators.__lshift__||FE**rCc.|jt|S)zimplement the >> operator. Not used by SQLAlchemy core, this is provided for custom operator systems which want to use >> as an extension point. )rTrrUs r@ __rshift__zColumnOperators.__rshift__rrCc.|jt|S)zImplement the 'concat' operator. In a column context, produces the clause ``a || b``, or uses the ``concat()`` operator on MySQL. )rT concat_oprUs r@concatzColumnOperators.concats||Iu--rCc.|jt|S)z|Implement an 'rconcat' operator. this is for internal use at the moment .. versionadded:: 1.4.40 )rprrUs r@_rconcatzColumnOperators._rconcats##Iu55rCc2|jt||S)aImplement the ``like`` operator. In a column context, produces the expression: .. sourcecode:: sql a LIKE other E.g.:: stmt = select(sometable).where(sometable.c.column.like("%foobar%")) :param other: expression to be compared :param escape: optional escape character, renders the ``ESCAPE`` keyword, e.g.:: somecolumn.like("foo/%bar", escape="/") .. seealso:: :meth:`.ColumnOperators.ilike` escape)rTlike_opr;r>rs r@likezColumnOperators.likes4||GU6|::rCc2|jt||S)aImplement the ``ilike`` operator, e.g. case insensitive LIKE. In a column context, produces an expression either of the form: .. sourcecode:: sql lower(a) LIKE lower(other) Or on backends that support the ILIKE operator: .. sourcecode:: sql a ILIKE other E.g.:: stmt = select(sometable).where(sometable.c.column.ilike("%foobar%")) :param other: expression to be compared :param escape: optional escape character, renders the ``ESCAPE`` keyword, e.g.:: somecolumn.ilike("foo/%bar", escape="/") .. seealso:: :meth:`.ColumnOperators.like` r)rTilike_oprs r@ilikezColumnOperators.ilikes@||HeF|;;rCc.|jt|S)zProduce a bitwise XOR operation, typically via the ``^`` operator, or ``#`` for PostgreSQL. .. versionadded:: 2.0.2 .. seealso:: :ref:`operators_bitwise` )rTbitwise_xor_oprUs r@ bitwise_xorzColumnOperators.bitwise_xor||NE22rCc.|jt|S)zProduce a bitwise OR operation, typically via the ``|`` operator. .. versionadded:: 2.0.2 .. seealso:: :ref:`operators_bitwise` )rT bitwise_or_oprUs r@ bitwise_orzColumnOperators.bitwise_ors||M511rCc.|jt|S)zProduce a bitwise AND operation, typically via the ``&`` operator. .. versionadded:: 2.0.2 .. seealso:: :ref:`operators_bitwise` )rTbitwise_and_oprUs r@ bitwise_andzColumnOperators.bitwise_andrrCc,|jtS)zProduce a bitwise NOT operation, typically via the ``~`` operator. .. versionadded:: 2.0.2 .. seealso:: :ref:`operators_bitwise` )rTbitwise_not_oprZs r@ bitwise_notzColumnOperators.bitwise_not"s||N++rCc.|jt|S)zProduce a bitwise LSHIFT operation, typically via the ``<<`` operator. .. versionadded:: 2.0.2 .. seealso:: :ref:`operators_bitwise` )rTbitwise_lshift_oprUs r@bitwise_lshiftzColumnOperators.bitwise_lshift0||-u55rCc.|jt|S)zProduce a bitwise RSHIFT operation, typically via the ``>>`` operator. .. versionadded:: 2.0.2 .. seealso:: :ref:`operators_bitwise` )rTbitwise_rshift_oprUs r@bitwise_rshiftzColumnOperators.bitwise_rshift>rrCc.|jt|S)a Implement the ``in`` operator. In a column context, produces the clause ``column IN ``. The given parameter ``other`` may be: * A list of literal values, e.g.:: stmt.where(column.in_([1, 2, 3])) In this calling form, the list of items is converted to a set of bound parameters the same length as the list given: .. sourcecode:: sql WHERE COL IN (?, ?, ?) * A list of tuples may be provided if the comparison is against a :func:`.tuple_` containing multiple expressions:: from sqlalchemy import tuple_ stmt.where(tuple_(col1, col2).in_([(1, 10), (2, 20), (3, 30)])) * An empty list, e.g.:: stmt.where(column.in_([])) In this calling form, the expression renders an "empty set" expression. These expressions are tailored to individual backends and are generally trying to get an empty SELECT statement as a subquery. Such as on SQLite, the expression is: .. sourcecode:: sql WHERE col IN (SELECT 1 FROM (SELECT 1) WHERE 1!=1) .. versionchanged:: 1.4 empty IN expressions now use an execution-time generated SELECT subquery in all cases. * A bound parameter, e.g. :func:`.bindparam`, may be used if it includes the :paramref:`.bindparam.expanding` flag:: stmt.where(column.in_(bindparam("value", expanding=True))) In this calling form, the expression renders a special non-SQL placeholder expression that looks like: .. sourcecode:: sql WHERE COL IN ([EXPANDING_value]) This placeholder expression is intercepted at statement execution time to be converted into the variable number of bound parameter form illustrated earlier. If the statement were executed as:: connection.execute(stmt, {"value": [1, 2, 3]}) The database would be passed a bound parameter for each value: .. sourcecode:: sql WHERE COL IN (?, ?, ?) .. versionadded:: 1.2 added "expanding" bound parameters If an empty list is passed, a special "empty list" expression, which is specific to the database in use, is rendered. On SQLite this would be: .. sourcecode:: sql WHERE COL IN (SELECT 1 FROM (SELECT 1) WHERE 1!=1) .. versionadded:: 1.3 "expanding" bound parameters now support empty lists * a :func:`_expression.select` construct, which is usually a correlated scalar select:: stmt.where( column.in_(select(othertable.c.y).where(table.c.x == othertable.c.x)) ) In this calling form, :meth:`.ColumnOperators.in_` renders as given: .. sourcecode:: sql WHERE COL IN (SELECT othertable.y FROM othertable WHERE othertable.x = table.x) :param other: a list of literals, a :func:`_expression.select` construct, or a :func:`.bindparam` construct that includes the :paramref:`.bindparam.expanding` flag set to True. )rTin_oprUs r@in_zColumnOperators.in_LsF||E5))rCc.|jt|S)aimplement the ``NOT IN`` operator. This is equivalent to using negation with :meth:`.ColumnOperators.in_`, i.e. ``~x.in_(y)``. In the case that ``other`` is an empty sequence, the compiler produces an "empty not in" expression. This defaults to the expression "1 = 1" to produce true in all cases. The :paramref:`_sa.create_engine.empty_in_strategy` may be used to alter this behavior. .. versionchanged:: 1.4 The ``not_in()`` operator is renamed from ``notin_()`` in previous releases. The previous name remains available for backwards compatibility. .. versionchanged:: 1.2 The :meth:`.ColumnOperators.in_` and :meth:`.ColumnOperators.not_in` operators now produce a "static" expression for an empty IN sequence by default. .. seealso:: :meth:`.ColumnOperators.in_` )rT not_in_oprUs r@not_inzColumnOperators.not_ins4||Iu--rCcyr9r5rUs r@notin_zColumnOperators.notin_rrCc2|jt||S)aimplement the ``NOT LIKE`` operator. This is equivalent to using negation with :meth:`.ColumnOperators.like`, i.e. ``~x.like(y)``. .. versionchanged:: 1.4 The ``not_like()`` operator is renamed from ``notlike()`` in previous releases. The previous name remains available for backwards compatibility. .. seealso:: :meth:`.ColumnOperators.like` r)rT not_like_oprs r@not_likezColumnOperators.not_likes"||Kv|>>rCcyr9r5rs r@notlikezColumnOperators.notlikerrCc2|jt||S)aimplement the ``NOT ILIKE`` operator. This is equivalent to using negation with :meth:`.ColumnOperators.ilike`, i.e. ``~x.ilike(y)``. .. versionchanged:: 1.4 The ``not_ilike()`` operator is renamed from ``notilike()`` in previous releases. The previous name remains available for backwards compatibility. .. seealso:: :meth:`.ColumnOperators.ilike` r)rT not_ilike_oprs r@ not_ilikezColumnOperators.not_ilikes"||L%|??rCcyr9r5rs r@notilikezColumnOperators.notilikerrCc.|jt|S)aWImplement the ``IS`` operator. Normally, ``IS`` is generated automatically when comparing to a value of ``None``, which resolves to ``NULL``. However, explicit usage of ``IS`` may be desirable if comparing to boolean values on certain platforms. .. seealso:: :meth:`.ColumnOperators.is_not` )rTis_rUs r@rzColumnOperators.is_s||C''rCc.|jt|S)a%Implement the ``IS NOT`` operator. Normally, ``IS NOT`` is generated automatically when comparing to a value of ``None``, which resolves to ``NULL``. However, explicit usage of ``IS NOT`` may be desirable if comparing to boolean values on certain platforms. .. versionchanged:: 1.4 The ``is_not()`` operator is renamed from ``isnot()`` in previous releases. The previous name remains available for backwards compatibility. .. seealso:: :meth:`.ColumnOperators.is_` )rTis_notrUs r@rzColumnOperators.is_nots||FE**rCcyr9r5rUs r@isnotzColumnOperators.isnot0rrCc4|jt|||S)a Implement the ``startswith`` operator. Produces a LIKE expression that tests against a match for the start of a string value: .. sourcecode:: sql column LIKE || '%' E.g.:: stmt = select(sometable).where(sometable.c.column.startswith("foobar")) Since the operator uses ``LIKE``, wildcard characters ``"%"`` and ``"_"`` that are present inside the expression will behave like wildcards as well. For literal string values, the :paramref:`.ColumnOperators.startswith.autoescape` flag may be set to ``True`` to apply escaping to occurrences of these characters within the string value so that they match as themselves and not as wildcard characters. Alternatively, the :paramref:`.ColumnOperators.startswith.escape` parameter will establish a given character as an escape character which can be of use when the target expression is not a literal string. :param other: expression to be compared. This is usually a plain string value, but can also be an arbitrary SQL expression. LIKE wildcard characters ``%`` and ``_`` are not escaped by default unless the :paramref:`.ColumnOperators.startswith.autoescape` flag is set to True. :param autoescape: boolean; when True, establishes an escape character within the LIKE expression, then applies it to all occurrences of ``"%"``, ``"_"`` and the escape character itself within the comparison value, which is assumed to be a literal string and not a SQL expression. An expression such as:: somecolumn.startswith("foo%bar", autoescape=True) Will render as: .. sourcecode:: sql somecolumn LIKE :param || '%' ESCAPE '/' With the value of ``:param`` as ``"foo/%bar"``. :param escape: a character which when given will render with the ``ESCAPE`` keyword to establish that character as the escape character. This character can then be placed preceding occurrences of ``%`` and ``_`` to allow them to act as themselves and not wildcard characters. An expression such as:: somecolumn.startswith("foo/%bar", escape="^") Will render as: .. sourcecode:: sql somecolumn LIKE :param || '%' ESCAPE '^' The parameter may also be combined with :paramref:`.ColumnOperators.startswith.autoescape`:: somecolumn.startswith("foo%bar^bat", escape="^", autoescape=True) Where above, the given literal parameter will be converted to ``"foo^%bar^^bat"`` before being passed to the database. .. seealso:: :meth:`.ColumnOperators.endswith` :meth:`.ColumnOperators.contains` :meth:`.ColumnOperators.like` r autoescape)rT startswith_opr;r>rrs r@ startswithzColumnOperators.startswith5s$n|| 5J  rCc4|jt|||S)a Implement the ``istartswith`` operator, e.g. case insensitive version of :meth:`.ColumnOperators.startswith`. Produces a LIKE expression that tests against an insensitive match for the start of a string value: .. sourcecode:: sql lower(column) LIKE lower() || '%' E.g.:: stmt = select(sometable).where(sometable.c.column.istartswith("foobar")) Since the operator uses ``LIKE``, wildcard characters ``"%"`` and ``"_"`` that are present inside the expression will behave like wildcards as well. For literal string values, the :paramref:`.ColumnOperators.istartswith.autoescape` flag may be set to ``True`` to apply escaping to occurrences of these characters within the string value so that they match as themselves and not as wildcard characters. Alternatively, the :paramref:`.ColumnOperators.istartswith.escape` parameter will establish a given character as an escape character which can be of use when the target expression is not a literal string. :param other: expression to be compared. This is usually a plain string value, but can also be an arbitrary SQL expression. LIKE wildcard characters ``%`` and ``_`` are not escaped by default unless the :paramref:`.ColumnOperators.istartswith.autoescape` flag is set to True. :param autoescape: boolean; when True, establishes an escape character within the LIKE expression, then applies it to all occurrences of ``"%"``, ``"_"`` and the escape character itself within the comparison value, which is assumed to be a literal string and not a SQL expression. An expression such as:: somecolumn.istartswith("foo%bar", autoescape=True) Will render as: .. sourcecode:: sql lower(somecolumn) LIKE lower(:param) || '%' ESCAPE '/' With the value of ``:param`` as ``"foo/%bar"``. :param escape: a character which when given will render with the ``ESCAPE`` keyword to establish that character as the escape character. This character can then be placed preceding occurrences of ``%`` and ``_`` to allow them to act as themselves and not wildcard characters. An expression such as:: somecolumn.istartswith("foo/%bar", escape="^") Will render as: .. sourcecode:: sql lower(somecolumn) LIKE lower(:param) || '%' ESCAPE '^' The parameter may also be combined with :paramref:`.ColumnOperators.istartswith.autoescape`:: somecolumn.istartswith("foo%bar^bat", escape="^", autoescape=True) Where above, the given literal parameter will be converted to ``"foo^%bar^^bat"`` before being passed to the database. .. seealso:: :meth:`.ColumnOperators.startswith` r)rTistartswith_oprs r@ istartswithzColumnOperators.istartswiths$f|| E&Z  rCc4|jt|||S)a Implement the 'endswith' operator. Produces a LIKE expression that tests against a match for the end of a string value: .. sourcecode:: sql column LIKE '%' || E.g.:: stmt = select(sometable).where(sometable.c.column.endswith("foobar")) Since the operator uses ``LIKE``, wildcard characters ``"%"`` and ``"_"`` that are present inside the expression will behave like wildcards as well. For literal string values, the :paramref:`.ColumnOperators.endswith.autoescape` flag may be set to ``True`` to apply escaping to occurrences of these characters within the string value so that they match as themselves and not as wildcard characters. Alternatively, the :paramref:`.ColumnOperators.endswith.escape` parameter will establish a given character as an escape character which can be of use when the target expression is not a literal string. :param other: expression to be compared. This is usually a plain string value, but can also be an arbitrary SQL expression. LIKE wildcard characters ``%`` and ``_`` are not escaped by default unless the :paramref:`.ColumnOperators.endswith.autoescape` flag is set to True. :param autoescape: boolean; when True, establishes an escape character within the LIKE expression, then applies it to all occurrences of ``"%"``, ``"_"`` and the escape character itself within the comparison value, which is assumed to be a literal string and not a SQL expression. An expression such as:: somecolumn.endswith("foo%bar", autoescape=True) Will render as: .. sourcecode:: sql somecolumn LIKE '%' || :param ESCAPE '/' With the value of ``:param`` as ``"foo/%bar"``. :param escape: a character which when given will render with the ``ESCAPE`` keyword to establish that character as the escape character. This character can then be placed preceding occurrences of ``%`` and ``_`` to allow them to act as themselves and not wildcard characters. An expression such as:: somecolumn.endswith("foo/%bar", escape="^") Will render as: .. sourcecode:: sql somecolumn LIKE '%' || :param ESCAPE '^' The parameter may also be combined with :paramref:`.ColumnOperators.endswith.autoescape`:: somecolumn.endswith("foo%bar^bat", escape="^", autoescape=True) Where above, the given literal parameter will be converted to ``"foo^%bar^^bat"`` before being passed to the database. .. seealso:: :meth:`.ColumnOperators.startswith` :meth:`.ColumnOperators.contains` :meth:`.ColumnOperators.like` r)rT endswith_oprs r@endswithzColumnOperators.endswiths$n|| v*  rCc4|jt|||S)a Implement the ``iendswith`` operator, e.g. case insensitive version of :meth:`.ColumnOperators.endswith`. Produces a LIKE expression that tests against an insensitive match for the end of a string value: .. sourcecode:: sql lower(column) LIKE '%' || lower() E.g.:: stmt = select(sometable).where(sometable.c.column.iendswith("foobar")) Since the operator uses ``LIKE``, wildcard characters ``"%"`` and ``"_"`` that are present inside the expression will behave like wildcards as well. For literal string values, the :paramref:`.ColumnOperators.iendswith.autoescape` flag may be set to ``True`` to apply escaping to occurrences of these characters within the string value so that they match as themselves and not as wildcard characters. Alternatively, the :paramref:`.ColumnOperators.iendswith.escape` parameter will establish a given character as an escape character which can be of use when the target expression is not a literal string. :param other: expression to be compared. This is usually a plain string value, but can also be an arbitrary SQL expression. LIKE wildcard characters ``%`` and ``_`` are not escaped by default unless the :paramref:`.ColumnOperators.iendswith.autoescape` flag is set to True. :param autoescape: boolean; when True, establishes an escape character within the LIKE expression, then applies it to all occurrences of ``"%"``, ``"_"`` and the escape character itself within the comparison value, which is assumed to be a literal string and not a SQL expression. An expression such as:: somecolumn.iendswith("foo%bar", autoescape=True) Will render as: .. sourcecode:: sql lower(somecolumn) LIKE '%' || lower(:param) ESCAPE '/' With the value of ``:param`` as ``"foo/%bar"``. :param escape: a character which when given will render with the ``ESCAPE`` keyword to establish that character as the escape character. This character can then be placed preceding occurrences of ``%`` and ``_`` to allow them to act as themselves and not wildcard characters. An expression such as:: somecolumn.iendswith("foo/%bar", escape="^") Will render as: .. sourcecode:: sql lower(somecolumn) LIKE '%' || lower(:param) ESCAPE '^' The parameter may also be combined with :paramref:`.ColumnOperators.iendswith.autoescape`:: somecolumn.endswith("foo%bar^bat", escape="^", autoescape=True) Where above, the given literal parameter will be converted to ``"foo^%bar^^bat"`` before being passed to the database. .. seealso:: :meth:`.ColumnOperators.endswith` r)rT iendswith_oprs r@ iendswithzColumnOperators.iendswithBs$f|| %:  rCc 2|jt|fi|S)a Implement the 'contains' operator. Produces a LIKE expression that tests against a match for the middle of a string value: .. sourcecode:: sql column LIKE '%' || || '%' E.g.:: stmt = select(sometable).where(sometable.c.column.contains("foobar")) Since the operator uses ``LIKE``, wildcard characters ``"%"`` and ``"_"`` that are present inside the expression will behave like wildcards as well. For literal string values, the :paramref:`.ColumnOperators.contains.autoescape` flag may be set to ``True`` to apply escaping to occurrences of these characters within the string value so that they match as themselves and not as wildcard characters. Alternatively, the :paramref:`.ColumnOperators.contains.escape` parameter will establish a given character as an escape character which can be of use when the target expression is not a literal string. :param other: expression to be compared. This is usually a plain string value, but can also be an arbitrary SQL expression. LIKE wildcard characters ``%`` and ``_`` are not escaped by default unless the :paramref:`.ColumnOperators.contains.autoescape` flag is set to True. :param autoescape: boolean; when True, establishes an escape character within the LIKE expression, then applies it to all occurrences of ``"%"``, ``"_"`` and the escape character itself within the comparison value, which is assumed to be a literal string and not a SQL expression. An expression such as:: somecolumn.contains("foo%bar", autoescape=True) Will render as: .. sourcecode:: sql somecolumn LIKE '%' || :param || '%' ESCAPE '/' With the value of ``:param`` as ``"foo/%bar"``. :param escape: a character which when given will render with the ``ESCAPE`` keyword to establish that character as the escape character. This character can then be placed preceding occurrences of ``%`` and ``_`` to allow them to act as themselves and not wildcard characters. An expression such as:: somecolumn.contains("foo/%bar", escape="^") Will render as: .. sourcecode:: sql somecolumn LIKE '%' || :param || '%' ESCAPE '^' The parameter may also be combined with :paramref:`.ColumnOperators.contains.autoescape`:: somecolumn.contains("foo%bar^bat", escape="^", autoescape=True) Where above, the given literal parameter will be converted to ``"foo^%bar^^bat"`` before being passed to the database. .. seealso:: :meth:`.ColumnOperators.startswith` :meth:`.ColumnOperators.endswith` :meth:`.ColumnOperators.like` )rT contains_opr;r>kws r@rzColumnOperators.containssft||K5"55rCc 2|jt|fi|S)a Implement the ``icontains`` operator, e.g. case insensitive version of :meth:`.ColumnOperators.contains`. Produces a LIKE expression that tests against an insensitive match for the middle of a string value: .. sourcecode:: sql lower(column) LIKE '%' || lower() || '%' E.g.:: stmt = select(sometable).where(sometable.c.column.icontains("foobar")) Since the operator uses ``LIKE``, wildcard characters ``"%"`` and ``"_"`` that are present inside the expression will behave like wildcards as well. For literal string values, the :paramref:`.ColumnOperators.icontains.autoescape` flag may be set to ``True`` to apply escaping to occurrences of these characters within the string value so that they match as themselves and not as wildcard characters. Alternatively, the :paramref:`.ColumnOperators.icontains.escape` parameter will establish a given character as an escape character which can be of use when the target expression is not a literal string. :param other: expression to be compared. This is usually a plain string value, but can also be an arbitrary SQL expression. LIKE wildcard characters ``%`` and ``_`` are not escaped by default unless the :paramref:`.ColumnOperators.icontains.autoescape` flag is set to True. :param autoescape: boolean; when True, establishes an escape character within the LIKE expression, then applies it to all occurrences of ``"%"``, ``"_"`` and the escape character itself within the comparison value, which is assumed to be a literal string and not a SQL expression. An expression such as:: somecolumn.icontains("foo%bar", autoescape=True) Will render as: .. sourcecode:: sql lower(somecolumn) LIKE '%' || lower(:param) || '%' ESCAPE '/' With the value of ``:param`` as ``"foo/%bar"``. :param escape: a character which when given will render with the ``ESCAPE`` keyword to establish that character as the escape character. This character can then be placed preceding occurrences of ``%`` and ``_`` to allow them to act as themselves and not wildcard characters. An expression such as:: somecolumn.icontains("foo/%bar", escape="^") Will render as: .. sourcecode:: sql lower(somecolumn) LIKE '%' || lower(:param) || '%' ESCAPE '^' The parameter may also be combined with :paramref:`.ColumnOperators.contains.autoescape`:: somecolumn.icontains("foo%bar^bat", escape="^", autoescape=True) Where above, the given literal parameter will be converted to ``"foo^%bar^^bat"`` before being passed to the database. .. seealso:: :meth:`.ColumnOperators.contains` )rT icontains_oprs r@ icontainszColumnOperators.icontainss^t||L%6266rCc 2|jt|fi|S)aImplements a database-specific 'match' operator. :meth:`_sql.ColumnOperators.match` attempts to resolve to a MATCH-like function or operator provided by the backend. Examples include: * PostgreSQL - renders ``x @@ plainto_tsquery(y)`` .. versionchanged:: 2.0 ``plainto_tsquery()`` is used instead of ``to_tsquery()`` for PostgreSQL now; for compatibility with other forms, see :ref:`postgresql_match`. * MySQL - renders ``MATCH (x) AGAINST (y IN BOOLEAN MODE)`` .. seealso:: :class:`_mysql.match` - MySQL specific construct with additional features. * Oracle Database - renders ``CONTAINS(x, y)`` * other backends may provide special implementations. * Backends without any special implementation will emit the operator as "MATCH". This is compatible with SQLite, for example. )rTmatch_op)r;r>r?s r@matchzColumnOperators.match?s8t||He6v66rCc2|jt||S)a Implements a database-specific 'regexp match' operator. E.g.:: stmt = select(table.c.some_column).where( table.c.some_column.regexp_match("^(b|c)") ) :meth:`_sql.ColumnOperators.regexp_match` attempts to resolve to a REGEXP-like function or operator provided by the backend, however the specific regular expression syntax and flags available are **not backend agnostic**. Examples include: * PostgreSQL - renders ``x ~ y`` or ``x !~ y`` when negated. * Oracle Database - renders ``REGEXP_LIKE(x, y)`` * SQLite - uses SQLite's ``REGEXP`` placeholder operator and calls into the Python ``re.match()`` builtin. * other backends may provide special implementations. * Backends without any special implementation will emit the operator as "REGEXP" or "NOT REGEXP". This is compatible with SQLite and MySQL, for example. Regular expression support is currently implemented for Oracle Database, PostgreSQL, MySQL and MariaDB. Partial support is available for SQLite. Support among third-party dialects may vary. :param pattern: The regular expression pattern string or column clause. :param flags: Any regular expression string flags to apply, passed as plain Python string only. These flags are backend specific. Some backends, like PostgreSQL and MariaDB, may alternatively specify the flags as part of the pattern. When using the ignore case flag 'i' in PostgreSQL, the ignore case regexp match operator ``~*`` or ``!~*`` will be used. .. versionadded:: 1.4 .. versionchanged:: 1.4.48, 2.0.18 Note that due to an implementation error, the "flags" parameter previously accepted SQL expression objects such as column expressions in addition to plain Python strings. This implementation did not work correctly with caching and was removed; strings only should be passed for the "flags" parameter, as these flags are rendered as literal inline values within SQL expressions. .. seealso:: :meth:`_sql.ColumnOperators.regexp_replace` flags)rTregexp_match_op)r;patternrs r@ regexp_matchzColumnOperators.regexp_match]sp||OWE|BBrCc4|jt|||S)aImplements a database-specific 'regexp replace' operator. E.g.:: stmt = select( table.c.some_column.regexp_replace("b(..)", "XY", flags="g") ) :meth:`_sql.ColumnOperators.regexp_replace` attempts to resolve to a REGEXP_REPLACE-like function provided by the backend, that usually emit the function ``REGEXP_REPLACE()``. However, the specific regular expression syntax and flags available are **not backend agnostic**. Regular expression replacement support is currently implemented for Oracle Database, PostgreSQL, MySQL 8 or greater and MariaDB. Support among third-party dialects may vary. :param pattern: The regular expression pattern string or column clause. :param pattern: The replacement string or column clause. :param flags: Any regular expression string flags to apply, passed as plain Python string only. These flags are backend specific. Some backends, like PostgreSQL and MariaDB, may alternatively specify the flags as part of the pattern. .. versionadded:: 1.4 .. versionchanged:: 1.4.48, 2.0.18 Note that due to an implementation error, the "flags" parameter previously accepted SQL expression objects such as column expressions in addition to plain Python strings. This implementation did not work correctly with caching and was removed; strings only should be passed for the "flags" parameter, as these flags are rendered as literal inline values within SQL expressions. .. seealso:: :meth:`_sql.ColumnOperators.regexp_match`  replacementr)rTregexp_replace_op)r;r rrs r@regexp_replacezColumnOperators.regexp_replaces'Z||  #   rCc,|jtS)zLProduce a :func:`_expression.desc` clause against the parent object.)rTdesc_oprZs r@desczColumnOperators.descs||G$$rCc,|jtS)zKProduce a :func:`_expression.asc` clause against the parent object.)rTasc_oprZs r@asczColumnOperators.ascs||F##rCc,|jtS)a*Produce a :func:`_expression.nulls_first` clause against the parent object. .. versionchanged:: 1.4 The ``nulls_first()`` operator is renamed from ``nullsfirst()`` in previous releases. The previous name remains available for backwards compatibility. )rTnulls_first_oprZs r@ nulls_firstzColumnOperators.nulls_firsts||N++rCcyr9r5rZs r@ nullsfirstzColumnOperators.nullsfirstrrCc,|jtS)a'Produce a :func:`_expression.nulls_last` clause against the parent object. .. versionchanged:: 1.4 The ``nulls_last()`` operator is renamed from ``nullslast()`` in previous releases. The previous name remains available for backwards compatibility. )rT nulls_last_oprZs r@ nulls_lastzColumnOperators.nulls_lasts||M**rCcyr9r5rZs r@ nullslastzColumnOperators.nullslastrrCc.|jt|S)zProduce a :func:`_expression.collate` clause against the parent object, given the collation string. .. seealso:: :func:`_expression.collate` )rTcollate)r; collations r@r"zColumnOperators.collates||GY//rCc.|jt|S)zaImplement the ``+`` operator in reverse. See :meth:`.ColumnOperators.__add__`. )rprrUs r@__radd__zColumnOperators.__radd__ ##C//rCc.|jt|S)zaImplement the ``-`` operator in reverse. See :meth:`.ColumnOperators.__sub__`. )rprrUs r@__rsub__zColumnOperators.__rsub__ r&rCc.|jt|S)zaImplement the ``*`` operator in reverse. See :meth:`.ColumnOperators.__mul__`. )rprrUs r@__rmul__zColumnOperators.__rmul__r&rCc.|jt|S)zaImplement the ``%`` operator in reverse. See :meth:`.ColumnOperators.__mod__`. )rprrUs r@__rmod__zColumnOperators.__rmod__r&rCc4|jt|||S)zzProduce a :func:`_expression.between` clause against the parent object, given the lower and upper range.  symmetric)rT between_op)r;cleftcrightr/s r@betweenzColumnOperators.between$s||Jv|KKrCc,|jtS)zZProduce a :func:`_expression.distinct` clause against the parent object. )rT distinct_oprZs r@distinctzColumnOperators.distinct-s ||K((rCc,|jtS)aProduce an :func:`_expression.any_` clause against the parent object. See the documentation for :func:`_sql.any_` for examples. .. note:: be sure to not confuse the newer :meth:`_sql.ColumnOperators.any_` method with the **legacy** version of this method, the :meth:`_types.ARRAY.Comparator.any` method that's specific to :class:`_types.ARRAY`, which uses a different calling style. )rTany_oprZs r@any_zColumnOperators.any_4||F##rCc,|jtS)aProduce an :func:`_expression.all_` clause against the parent object. See the documentation for :func:`_sql.all_` for examples. .. note:: be sure to not confuse the newer :meth:`_sql.ColumnOperators.all_` method with the **legacy** version of this method, the :meth:`_types.ARRAY.Comparator.all` method that's specific to :class:`_types.ARRAY`, which uses a different calling style. )rTall_oprZs r@all_zColumnOperators.all_Cr:rCc.|jt|S)a4Implement the ``+`` operator. In a column context, produces the clause ``a + b`` if the parent object has non-string affinity. If the parent object has a string affinity, produces the concatenation operator, ``a || b`` - see :meth:`.ColumnOperators.concat`. )rTrrUs r@__add__zColumnOperators.__add__Rs||C''rCc.|jt|S)zdImplement the ``-`` operator. In a column context, produces the clause ``a - b``. )rTrrUs r@__sub__zColumnOperators.__sub__^ ||C''rCc.|jt|S)zdImplement the ``*`` operator. In a column context, produces the clause ``a * b``. )rTrrUs r@__mul__zColumnOperators.__mul__frBrCc.|jt|S)zdImplement the ``%`` operator. In a column context, produces the clause ``a % b``. )rTrrUs r@__mod__zColumnOperators.__mod__nrBrCc.|jt|S)aSImplement the ``/`` operator. In a column context, produces the clause ``a / b``, and considers the result type to be numeric. .. versionchanged:: 2.0 The truediv operator against two integers is now considered to return a numeric value. Behavior on specific backends may vary. )rTrrUs r@ __truediv__zColumnOperators.__truediv__vs||GU++rCc.|jt|S)zeImplement the ``/`` operator in reverse. See :meth:`.ColumnOperators.__truediv__`. )rprrUs r@ __rtruediv__zColumnOperators.__rtruediv__s ##GU33rCc.|jt|S)zImplement the ``//`` operator. In a column context, produces the clause ``a / b``, which is the same as "truediv", but considers the result type to be integer. .. versionadded:: 2.0 )rTr rUs r@ __floordiv__zColumnOperators.__floordiv__s||He,,rCc.|jt|S)zgImplement the ``//`` operator in reverse. See :meth:`.ColumnOperators.__floordiv__`. )rpr rUs r@ __rfloordiv__zColumnOperators.__rfloordiv__s ##He44rC)rgr4r>rr?rrIr)r>rrIrr)rIr)rrrIrr9)r>rr Optional[str]rIrNF)r>rrrOrrrrIr)r>rrrrIr)r>rr?rrIr)r rrrOrIr)r rrrrrOrIr)r#r6rIrF)r1rr2rr/rrrIr)Or7rMrNrOrPrrQtypingr#rTrprrrrKrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrr r"r%r(r*r,r3r6r9r=r?rArDrFrHrJrLrNr5rCr@rrs#JI#I}#B  "" ",/ ";> "  " "" "+. ":= "  "''&%%''5 9I3''!-,++.637;;"/; ;:37 < <"/ <  488C8C#08C 8CvFJ2 2 ),2 5B2 2 h% $ ,4! +3  00000:?LL"%L26L L) $ $ (((( ,4 -5rCrzSet[Any] _commutative _comparisonc"tt|Sr9)rr4fns r@ _operator_fnrXs  b !!rCc0tj||Sr9)rSrrVs r@commutative_oprZsR IrCc0tj||Sr9)rTrrVs r@ comparison_opr\sOOB IrCctr9rmr5rCr@from_r_  rCctr9r^r5rCr@function_as_comparison_oprbs   rCctr9r^r5rCr@as_rdr`rCctr9r^r5rCr@existsrfr`rCctr9r^as r@is_truerjr`rCcyr9r5rhs r@istruerls"rCctr9r^rhs r@is_falsernr`rCcyr9r5rhs r@isfalserps #rCc$|j|Sr9)rribs r@rrs  a  rCc$|j|Sr9)rrrs r@rrs ! !! $$rCcyr9r5rrs r@rrs47rCc$|j|Sr9)rrrs r@rr 558OrCc$|j|Sr9)rrrs r@rr 88A;rCcyr9r5rrs r@rr &)rCc$|j|Sr9)r"rrs r@r"r"s 99Q<rCc0|j||Sr9ri)rircrss r@rgrgs 144>! rCc(|j||SNr)rrirsrs r@rrs 66!F6 ##rCc(|j||Sr)rrs r@rr!s 99Qv9 &&rCcyr9r5rs r@ notlike_opr*sILrCc(|j||Sr)rrs r@rr1s 771V7 $$rCc(|j||Sr)rrs r@rr7s ;;q; ((rCcyr9r5rs r@ notilike_opr@sJMrCc*|j|||SNr.r3rirscr/s r@r0r0Gs 99QY9 //rCc,|j|||Srrrs r@not_between_oprMs IIaiI 0 00rCcyr9r5rs r@ notbetween_oprVrCc$|j|Sr9)rrrs r@rr_rwrCc$|j|Sr9)rrrs r@rreryrCcyr9r5rrs r@notin_oprns),rCc"|jSr9)r6rhs r@r5r5us ::<rCc"|jSr9)r9rhs r@r8r8z 668OrCc"|jSr9)r=rhs r@r<r<rrCc |ry|durtjd|d}t|ts t d|dvr|j |||z}|j d|dzj d|dz}|||S) NTz;The autoescape parameter is now a simple boolean True/False/z*String value expected when autoescape=True)%_rrr)r(warnr}r6 TypeErrorreplace)rWr>rrs r@_escaped_like_implrs T ! IIM  >F%%HI I  #MM&&6/:E c6C<088fslK eF ##rCc2t|j|||Sr9rrrirsrrs r@rrs allAvz BBrCc4t|j|||Sr9rrs r@not_startswith_oprs q||Q C CCrCcyr9r5rs r@notstartswith_oprrrCc2t|j|||Sr9rrrs r@rrs ammQ CCrCc4t|j|||Sr9rrs r@not_istartswith_oprs q}}a D DDrCc2t|j|||Sr9rrrs r@rr ajj!VZ @@rCc4t|j|||Sr9rrs r@not_endswith_opr qzz1fj A AArCcyr9r5rs r@notendswith_oprrrCc2t|j|||Sr9rrrs r@rr akk1fj AArCc4t|j|||Sr9rrs r@not_iendswith_opr q{{Avz B BBrCc2t|j|||Sr9rrrs r@rrrrCc4t|j|||Sr9rrs r@not_contains_oprrrCcyr9r5rs r@notcontains_opr rrCc2t|j|||Sr9rrrs r@rr rrCc4t|j|||Sr9rrs r@not_icontains_opr rrCc (|j|fi|Sr9rrirsrs r@rr s 1771  rCc(|j||SNrr rirsrs r@r r $ s >>!5> ))rCc*|j||Srrrs r@not_regexp_match_opr* s NN1EN * **rCc*|j|||S)Nr )r)rirsrrs r@rr0 s  A;e  DDrCc *|j|fi|Sr9rrs r@ not_match_opr7 s AGGA   rCc yr9r5rs r@ notmatch_opr@ s7:rCctr9r^rrs r@comma_oprG r`rCctr9r^rrs r@ filter_oprL r`rCcl |j}||S#t$r|j|cYSwxYwr9)rAttributeErrorr)rirsrs r@rrQ s;ay zz!}s 33c"|jSr9)rrhs r@rr[ rrCc"|jSr9)rrhs r@rr` s 557NrCc"|jSr9)rrhs r@rre  ==?rCcyr9r5rhs r@ nullsfirst_oprm r{rCc"|jSr9)rrhs r@rrt s <<>rCcyr9r5rhs r@ nullslast_opr| s%(rCctr9r^rrs r@json_getitem_opr r`rCctr9r^rrs r@json_path_getitem_opr r`rCc$|j|Sr9)rrrs r@rr  == rCc$|j|Sr9)rrrs r@rr s <<?rCc$|j|Sr9)rrrs r@rr rrCc"|jSr9)rrhs r@rr rrCc$|j|Sr9)rrrs r@rr   A rCc$|j|Sr9)rrrs r@rr rrCcR|tvxst|txr |jSr9)rTr}rbreris r@rere s$   N 2y 9 Nb>N>NNrCc|tvSr9)rSris r@is_commutativer  rCc2|ttttfvSr9)rrrrris r@is_ordering_modifierr s &'>=A AArCcR|tvxst|txr |jSr9)_natural_self_precedentr}rbrwris r@is_natural_self_precedentr s- %% & b) $ &  % %rCc,t|xs|tvSr9)re _booleansris r@ is_booleanr s   /i/rCc.tj||S)z[rotate a comparison operator 180 degrees. Note this is not the same as negation. )_mirrorgetris r@mirrorr s ;;r2 rCc|tvSr9) _associativeris r@is_associativer rrCc|tvSr9)_order_by_modifierris r@is_order_by_modifierr s # ##rCctr9r^rhs r@_asboolr r`rCceZdZdZdZy)_OpLimitidN)r7rMrN _smallest_largestr5rCr@rr s IHrCrizDict[OperatorType, int] _PRECEDENCEc ||ur t|ry|yttj|t |dt j tj|t |dt jkS)NFTrd)rrrrrgetattrrr r )r_r`s r@ is_precedentr0 ss78B  OO'(L(:L:LM ,8I8IJ   rC)rWCallable[..., Any]rIr4)rWr2rIr2)rIr)rirrIr)rirrsrrIr)rirrcr6rsrrIrr9)rirrsrrrOrIrrQ) rirrsrrrr/rrrIr) rWrr>rrrOrrrrIrrP) rirrsrrrOrrrrIr)rirrsrrrrIr)rirrsrrrOrIr) rirrsrrrrrOrIr)rgr4rIrr)rgr4rIr4)rgOptional[OperatorType]rIrr)r_r4r`rrIrr)rO __future__renumrr_r _uncast_addr _uncast_and_r_uncast_containsr _uncast_eqr _uncast_floordivr _uncast_ger _uncast_getitemr _uncast_gtr _uncast_invr _uncast_ler_uncast_lshiftr _uncast_ltr _uncast_modr _uncast_mulr _uncast_ner _uncast_negr _uncast_or_r_uncast_rshiftr _uncast_subr_uncast_truedivrRrrrrrrrr r!r"r#r$r%r'r( util.typingr)r*_typingr, cache_keyr-elementsr.type_apir/r0r2r4rKrbrrSrQrTrXrZr\r_rbrdrfrjrlrnrprrrrrrr"rgrrrrrrr0rrrrrr5r8r<rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrerrrrrrrunion differencerrrrrrrrrr5rCr@r7s1"')1%1%/%'%-%''%''-'/  !" 1%'$ T e8CH-.8D <% L,'  . / , #  . / , # |_ - , # <% , # lN + , # <% <% , # <% <% lN + <% |_ -A+A+Hq gbkqhk5ik5\-b#s+ h+RRR0 X0"            ""F  ##G !! %% 77/   )) E $$ '' LLJ %% )) MMK 00 11 27 +/  #M   ,,H$$#&$0=$KO$$, EJC CC)C>BCCC  EJD DD)D>BDDDIN  -BF  ) EJD DD)D>BDDD  EJE EE)E>BEEE  EJA AA)A>BAAA  EJB BB)B>BBBBIN  -BF  %N EJB BB)B>BBBB  EJC CC)C>BCCC  EJA AA)A>BAAA  EJB BB)B>BBBBIN  -BF  %N EJB BB)B>BBBB  EJC CC)C>BCCC   ** ++=AE EE!$E-:EEE   ::K     ))#M ((!L    OB'8T3 / 0 r2r2r2r *!!9dC"89DDb"XN $v~}E&,, o34   w ;( 2;(r;( B;( B ;(  R ;( R ;(";(;( Q;( a;(;(;(A;(;(;( A!;("1#;($A%;(&q';((q);(*q+;(,q-;(. a/;(0!1;(2Q3;(45;(6q7;(8 a9;(:!;;(< Q=;(>?;(@ 1A;(BqC;(DE;(F AG;(HI;(JK;(LaM;(N!O;(PQ;(RS;(TU;(VW;(XY;(ZA[;(\];(^_;(` Qa;(b ac;(d !e;(fg;(h b Q A Q A Su;( $;|  %;   rC