BinOp#
- class astroid.nodes.BinOp(op: str, lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int | None, end_col_offset: int | None)[source]#
Bases:
OperatorNode
Class representing an
ast.BinOp
node.A
BinOp
node is an application of a binary operator.>>> import astroid >>> node = astroid.extract_node('a + b') >>> node <BinOp l.1 at 0x7f23b2e8cfd0>
- op#
The operator.
- type_errors(context: InferenceContext | None = None)[source]#
Get a list of type errors which can occur during inference.
Each TypeError is represented by a
BadBinaryOperationMessage
, which holds the original exception.- Returns:
The list of possible type errors.
- Return type:
list(BadBinaryOperationMessage)