Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions ddtrace/debugging/_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ def _is_identifier(name: str) -> bool:
return isinstance(name, str) and name.isidentifier()


IN_OPERATOR_INSTR = Instr("COMPARE_OP", Compare.IN) if PY < (3, 9) else Instr("CONTAINS_OP", 0)
NOT_IN_OPERATOR_INSTR = Instr("COMPARE_OP", Compare.NOT_IN) if PY < (3, 9) else Instr("CONTAINS_OP", 1)


def short_circuit_instrs(op: str, label: Label) -> List[Instr]:
value = "FALSE" if op == "and" else "TRUE"
if PY >= (3, 13):
Expand Down Expand Up @@ -156,7 +152,7 @@ def _compile_direct_predicate(self, ast: DDASTType) -> Optional[List[Instr]]:

if _type == "isDefined":
value.append(Instr("LOAD_FAST", "_locals"))
value.append(IN_OPERATOR_INSTR)
value.append(Instr("CONTAINS_OP", 0))
else:
if PY >= (3, 13):
# UNARY_NOT requires a boolean value
Expand Down Expand Up @@ -201,7 +197,7 @@ def _compile_arg_predicate(self, ast: DDASTType) -> Optional[List[Instr]]:
raise ValueError("Invalid argument: %r" % a)
if cb is None:
raise ValueError("Invalid argument: %r" % b)
return cb + ca + [IN_OPERATOR_INSTR]
return cb + ca + [Instr("CONTAINS_OP", 0)]

if _type in {"any", "all"}:
a, b = args
Expand Down
Loading