implement 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 express
(self, other: Any)
| 1138 | return self.operate(in_op, other) |
| 1139 | |
| 1140 | def not_in(self, other: Any) -> ColumnOperators: |
| 1141 | """implement the ``NOT IN`` operator. |
| 1142 | |
| 1143 | This is equivalent to using negation with |
| 1144 | :meth:`.ColumnOperators.in_`, i.e. ``~x.in_(y)``. |
| 1145 | |
| 1146 | In the case that ``other`` is an empty sequence, the compiler |
| 1147 | produces an "empty not in" expression. This defaults to the |
| 1148 | expression "1 = 1" to produce true in all cases. The |
| 1149 | :paramref:`_sa.create_engine.empty_in_strategy` may be used to |
| 1150 | alter this behavior. |
| 1151 | |
| 1152 | .. versionchanged:: 1.4 The ``not_in()`` operator is renamed from |
| 1153 | ``notin_()`` in previous releases. The previous name remains |
| 1154 | available for backwards compatibility. |
| 1155 | |
| 1156 | .. seealso:: |
| 1157 | |
| 1158 | :meth:`.ColumnOperators.in_` |
| 1159 | |
| 1160 | """ |
| 1161 | return self.operate(not_in_op, other) |
| 1162 | |
| 1163 | # deprecated 1.4; see #5429 |
| 1164 | if TYPE_CHECKING: |