AugAssign¶
- class astroid.nodes.AugAssign(op: str, lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int | None, end_col_offset: int | None)[source]¶
Bases:
AssignTypeNode
,OperatorNode
,Statement
Class representing an
ast.AugAssign
node.An
AugAssign
is an assignment paired with an operator.>>> import astroid >>> node = astroid.extract_node('variable += 1') >>> node <AugAssign l.1 at 0x7effe1db4d68>
- assigned_stmts(**kwargs: _P.kwargs) Generator[InferenceResult] ¶
Returns the assigned statement (non inferred) according to the assignment type. See astroid/protocols.py for actual implementation.
- op¶
The operator that is being combined with the assignment.
This includes the equals sign.
- type_errors(context: InferenceContext | None = None) list[BadBinaryOperationMessage] [source]¶
Get a list of type errors which can occur during inference.
Each TypeError is represented by a
BadBinaryOperationMessage
, which holds the original exception.If any inferred result is uninferable, an empty list is returned.