class documentation

class FormattedValue(BaseNode): (source)

View In Hierarchy

Class representing an :class:`ast.FormattedValue` node. Represents a :pep:`498` format string.

Method __init__ :param lineno: The line that this node appears on in the source code. :param col_offset: The column that this node appears on in the source code. :param parent: The parent node in the syntax tree.
Method postinit Post initialization :param value: Any expression node that will format to string :param conversion: The type of formatting. :param format_spec: Representing the formatting of the value
Constant CONVERSION Undocumented
Instance Variable conversion The type of formatting.
Instance Variable format_spec Representing the formatting of the value,
Instance Variable value Any expression node that will format to string
Class Variable _fields Undocumented
Class Variable _other_fields Undocumented

Inherited from BaseNode:

Static Method get_inferred Undocumented
Method __contains__ Undocumented
Method accept Undocumented
Method dunder_lookup try to resolve the dunder method
Method generic_visit Undocumented
Method get_bound_conditions Undocumented
Method get_children Undocumented
Method get_from_outer find the definition of `var` from outer scope recursively. Skip param will determine how many parent scope to skip :param var: variable of interest :param skip: how many layer of parent scope to skip :return:...
Method get_parent_of_type Undocumented
Method get_statements Undocumented
Method get_stmt_target Undocumented
Method get_target_instance get the assigning target instance rather than scope(). See #mr68u a.b.c = node calling node.get_target_instance() will return `a.b.c.instance()`
Method is_children check if the given node is part of 'self' or children
Method iter_fields Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` that is present on *node*.
Method prepare_inferred_value Undocumented
Method scope return the first containing scope
Method statement Undocumented
Instance Variable col_offset Undocumented
Instance Variable explicit_inference Undocumented
Instance Variable lineno Undocumented
Instance Variable parent Undocumented
Instance Variable refer_to_block Undocumented
def __init__(self, lineno=None, col_offset=None, parent=None): (source)

:param lineno: The line that this node appears on in the source code. :param col_offset: The column that this node appears on in the source code. :param parent: The parent node in the syntax tree.

Parameters
lineno:Optional[int]Undocumented
col_offset:Optional[int]Undocumented
parent:Optional[BaseNode]Undocumented
def postinit(self, value, conversion, format_spec): (source)

Post initialization :param value: Any expression node that will format to string :param conversion: The type of formatting. :param format_spec: Representing the formatting of the value

Parameters
value:BaseNodeUndocumented
conversion:intUndocumented
format_spec:JoinedStrUndocumented
CONVERSION: dict[int, str] = (source)

Undocumented

Value
{-1: '', 115: 'str', 114: 'repr', 97: 'ascii'}
conversion = (source)

The type of formatting.

format_spec = (source)

Representing the formatting of the value,

value = (source)

Any expression node that will format to string

_fields: tuple[str, ...] = (source)

Undocumented

_other_fields: tuple[str, ...] = (source)

Undocumented