{"record":{"id":"192486c2a6e2caf6","repo":"huggingface/smolagents","slug":"operation-type-expression-op-name-is-not-su","errorCode":null,"errorMessage":"Operation {type(expression.op).__name__} is not supported.","messagePattern":"Operation (.+?) is not supported\\.","errorType":"error_code","errorClass":"InterpreterError","httpStatus":null,"severity":"warning","filePath":"src/smolagents/local_python_executor.py","lineNumber":695,"sourceCode":"        current_value /= value_to_add\n    elif isinstance(expression.op, ast.Mod):\n        current_value %= value_to_add\n    elif isinstance(expression.op, ast.Pow):\n        current_value **= value_to_add\n    elif isinstance(expression.op, ast.FloorDiv):\n        current_value //= value_to_add\n    elif isinstance(expression.op, ast.BitAnd):\n        current_value &= value_to_add\n    elif isinstance(expression.op, ast.BitOr):\n        current_value |= value_to_add\n    elif isinstance(expression.op, ast.BitXor):\n        current_value ^= value_to_add\n    elif isinstance(expression.op, ast.LShift):\n        current_value <<= value_to_add\n    elif isinstance(expression.op, ast.RShift):\n        current_value >>= value_to_add\n    else:\n        raise InterpreterError(f\"Operation {type(expression.op).__name__} is not supported.\")\n\n    # Update the state: current_value has been updated in-place\n    set_value(\n        expression.target,\n        current_value,\n        state,\n        static_tools,\n        custom_tools,\n        authorized_imports,\n    )\n\n    return current_value\n\n\ndef evaluate_boolop(\n    node: ast.BoolOp,\n    state: dict[str, Any],\n    static_tools: dict[str, Callable],","sourceCodeStart":677,"sourceCodeEnd":713,"githubUrl":"https://github.com/huggingface/smolagents/blob/30bb1161095dbae2271e6bc3cc4c219cc3897a57/src/smolagents/local_python_executor.py#L677-L713","documentation":"evaluate_augassign implements Add, Sub, Mult, Div, FloorDiv, Mod, Pow, BitOr, BitXor, BitAnd, LShift, RShift; any other operator node in an augmented assignment raises InterpreterError naming the op class. Standard Python cannot produce others, so this is an exhaustiveness guard.","triggerScenarios":"Only reachable with a programmatically constructed AST containing an exotic ast.operator in an AugAssign, or a future grammar change; normal source code always hits one of the implemented branches.","commonSituations":"Hand-built ASTs fed to evaluate_ast; version skew after a new Python release introduces an operator before smolagents adds support.","solutions":["Use one of the supported compound operators in executed code","Expand the operation manually (x = x <op> y) using a supported form","Upgrade smolagents if a newer release added the operator"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import ast\nSUPPORTED_OPS = (ast.Add, ast.Sub, ast.Mult, ast.Div, ast.FloorDiv, ast.Mod, ast.Pow,\n                 ast.BitOr, ast.BitXor, ast.BitAnd, ast.LShift, ast.RShift)\nfor node in ast.walk(ast.parse(code)):\n    if isinstance(node, ast.AugAssign) and not isinstance(node.op, SUPPORTED_OPS):\n        raise ValueError(f'unsupported augmented operator: {type(node.op).__name__}')","typeGuard":null,"tryCatchPattern":"from smolagents.local_python_executor import InterpreterError\ntry:\n    evaluate_python(code)\nexcept InterpreterError as e:\n    if 'is not supported' in str(e) and 'Operation' in str(e):\n        raise NotImplementedError(str(e)) from e","preventionTips":["Stick to the standard compound operators in executed code","Expand exotic compound ops into plain assignments","Upgrade smolagents when adopting new Python grammar features"],"tags":["smolagents","augmented-assignment","unsupported-operation","interpreter-error"],"backgroundTag":"unsupported-language-construct","analyzedSha":"30bb1161095dbae2271e6bc3cc4c219cc3897a57","analyzedAt":"2026-08-28T18:52:54.169Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}