MCPcopy Create free account
hub / github.com/PyTables/PyTables / fix_invert

Function fix_invert

tables/conditions.py:230–246  ·  view source on GitHub ↗
(
        idxcmp: tuple[Any, str, Any] | tuple[None, None, None],
        exprnode: ne.expressions.ExpressionNode,
        indexedcols: frozenset[str],
    )

Source from the content-addressed store, hash-verified

228 }
229
230 def fix_invert(
231 idxcmp: tuple[Any, str, Any] | tuple[None, None, None],
232 exprnode: ne.expressions.ExpressionNode,
233 indexedcols: frozenset[str],
234 ) -> tuple[
235 tuple[Any, str, Any] | tuple[None, None, None],
236 ne.expressions.ExpressionNode,
237 bool,
238 ]:
239 invert = False
240 # Loop until all leading negations have been dealt with
241 while idxcmp[1] == "invert":
242 invert ^= True
243 # The information about the negated node is in first position
244 exprnode = idxcmp[0]
245 idxcmp = _get_indexable_cmp(exprnode, indexedcols)
246 return idxcmp, exprnode, invert
247
248 # Indexable variable-constant comparison.
249 idxcmp = _get_indexable_cmp(exprnode, indexedcols)

Callers 1

_get_idx_expr_recurseFunction · 0.85

Calls 1

_get_indexable_cmpFunction · 0.85

Tested by

no test coverage detected