From 3013ad83a51114fe1ad7232584801f7f77867b9c Mon Sep 17 00:00:00 2001 From: "Gabriele N. Tornetta" Date: Tue, 18 Nov 2025 11:53:21 +0000 Subject: [PATCH] chore(debugging): remove EL support for CPython 3.8 We clean up the expression language implementation by removing support for CPython 3.8. --- ddtrace/debugging/_expressions.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ddtrace/debugging/_expressions.py b/ddtrace/debugging/_expressions.py index 1efa4238aa0..584148f4ddc 100644 --- a/ddtrace/debugging/_expressions.py +++ b/ddtrace/debugging/_expressions.py @@ -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): @@ -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 @@ -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