Interpolation

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

Bases: NodeNG

Class representing an ast.Interpolation node.

>>> import astroid
>>> node = astroid.extract_node('t"{name} finished {place!s}"')
>>> node
<TemplateStr l.1 at 0x...>
>>> node.values[0]
<Interpolation l.1 at 0x...>
>>> node.values[2]
<Interpolation l.1 at 0x...>
conversion: int

The type of formatting to be applied to the value.

format_spec: JoinedStr | None

The formatting to be applied to the value.

get_children() Iterator[NodeNG][source]

Get the child nodes below this node.

postinit(*, value: NodeNG, str: str, conversion: int = -1, format_spec: JoinedStr | None = None) None[source]
str: str

Text of the interpolation expression.

value: NodeNG

Any expression node.