Functions
compare_op
3
bool
▼
Evaluate a comparison operator.
compare_op
3
bool
▼
def compare_op(op: str, left: Any, right: Any) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
op |
str |
|
left |
Any |
|
right |
Any |
Returns
bool
try_eval_const_only
1
Any
▼
Evaluate an expression using only literals and constant operators.
Name, attri…
try_eval_const_only
1
Any
▼
def try_eval_const_only(expr: Expr) -> Any
Evaluate an expression using only literals and constant operators.
Name, attribute, and item lookups intentionally remain unresolved because they require a static context. Dead-code elimination uses this narrower evaluator even when no static context is configured.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
Expr |
Returns
Any