IfExp#

class astroid.nodes.IfExp(lineno: int | None, col_offset: int | None, parent: NodeNG | None, *, end_lineno: int | None, end_col_offset: int | None)[source]#

Bases: NodeNG

Class representing an ast.IfExp node. >>> import astroid >>> node = astroid.extract_node(‘value if condition else other’) >>> node <IfExp l.1 at 0x7f23b2e9dbe0>

body: NodeNG#

The contents of the block.

get_children()[source]#

Get the child nodes below this node.

op_left_associative() Literal[False][source]#
orelse: NodeNG#

The contents of the else block.

postinit(test: NodeNG, body: NodeNG, orelse: NodeNG) None[source]#
test: NodeNG#

The condition that the statement tests.