module documentation

Undocumented

Function ensure_literal Undocumented
Function op2func Return function for operator nodes.
Function safe_add safe version of add
Function safe_lshift safe version of lshift
Function safe_mult safe version of multiply
Function safe_pow safe version of pow
Constant MAX_EXPONENT Undocumented
Constant MAX_SHIFT Undocumented
Constant MAX_STR_LEN Undocumented
Type Variable T Undocumented
Type Alias ASTOrLiteralValue Undocumented
Type Alias LiteralValue Undocumented
Class _ASTEval Undocumented
Class _EvalBaseVisitor No class docstring; 0/1 instance variable, 0/1 constant, 1/4 method documented
Class _GotoDefinition Undocumented
Class _LiteralEval No class docstring; 0/2 instance variable, 1/19 method documented
Constant _AST_SEQUENCE_TO_TYPE Undocumented
Constant _OPERATORS Undocumented
Constant _UNARY_OPERATORS Undocumented

Undocumented

Return function for operator nodes.

def safe_add(arg1: Any, arg2: Any) -> Any: (source)

safe version of add

def safe_lshift(arg1: Any, arg2: Any) -> Any: (source)

safe version of lshift

def safe_mult(arg1: Any, arg2: Any) -> Any: (source)

safe version of multiply

def safe_pow(base: Any, exp: Any) -> Any: (source)

safe version of pow

MAX_EXPONENT: int = (source)

Undocumented

Value
10000
MAX_SHIFT: int = (source)

Undocumented

Value
1000
MAX_STR_LEN = (source)

Undocumented

Value
2 << 17

Undocumented

Value
TypeVar('T')
ASTOrLiteralValue = (source)

Undocumented

Value
LiteralValue | ast.AST
_AST_SEQUENCE_TO_TYPE: dict[type[ast.Tuple] | type[ast.List] | type[ast.Set], type[tuple] | type[list] | type[set]] = (source)

Undocumented

Value
{ast.Tuple: tuple, ast.List: list, ast.Set: set}

Undocumented

Value
{'Is': (lambda a, b: a is b),
 'IsNot': (lambda a, b: a is not b),
 'In': (lambda a, b: a in b),
 'NotIn': (lambda a, b: a not in b),
 'Add': safe_add,
 'BitAnd': (lambda a, b: a & b),
 'BitOr': (lambda a, b: a | b),
...

Undocumented

Value
{'Invert': (lambda a: ~a),
 'Not': (lambda a: not a),
 'UAdd': (lambda a: +a),
 'USub': (lambda a: -a)}