class documentation

Visitor for converting a node to a human-readable string. For example, an MypyFile node from program '1' is converted into something like this: MypyFile:1( fnam ExpressionStmt:1( IntExpr(1)))

Method __init__ Undocumented
Method dump Convert a list of items to a multiline pretty-printed string.
Method format_id Undocumented
Method func_helper Return a list in a format suitable for dump() that represents the arguments and the body of a function. The caller can then decorate the array with information specific to methods, global functions or anonymous functions.
Method get_id Undocumented
Method pretty_name Undocumented
Method str_repr Undocumented
Method visit__promote_expr Undocumented
Method visit_as_pattern Undocumented
Method visit_assert_stmt Undocumented
Method visit_assert_type_expr Undocumented
Method visit_assignment_expr Undocumented
Method visit_assignment_stmt Undocumented
Method visit_await_expr Undocumented
Method visit_block Undocumented
Method visit_break_stmt Undocumented
Method visit_bytes_expr Undocumented
Method visit_call_expr Undocumented
Method visit_cast_expr Undocumented
Method visit_class_def Undocumented
Method visit_class_pattern Undocumented
Method visit_comparison_expr Undocumented
Method visit_complex_expr Undocumented
Method visit_conditional_expr Undocumented
Method visit_continue_stmt Undocumented
Method visit_decorator Undocumented
Method visit_del_stmt Undocumented
Method visit_dict_expr Undocumented
Method visit_dictionary_comprehension Undocumented
Method visit_ellipsis Undocumented
Method visit_enum_call_expr Undocumented
Method visit_expression_stmt Undocumented
Method visit_float_expr Undocumented
Method visit_for_stmt Undocumented
Method visit_func_def Undocumented
Method visit_generator_expr Undocumented
Method visit_global_decl Undocumented
Method visit_if_stmt Undocumented
Method visit_import Undocumented
Method visit_import_all Undocumented
Method visit_import_from Undocumented
Method visit_index_expr Undocumented
Method visit_int_expr Undocumented
Method visit_lambda_expr Undocumented
Method visit_list_comprehension Undocumented
Method visit_list_expr Undocumented
Method visit_mapping_pattern Undocumented
Method visit_match_stmt Undocumented
Method visit_member_expr Undocumented
Method visit_mypy_file Undocumented
Method visit_name_expr Undocumented
Method visit_namedtuple_expr Undocumented
Method visit_newtype_expr Undocumented
Method visit_nonlocal_decl Undocumented
Method visit_op_expr Undocumented
Method visit_operator_assignment_stmt Undocumented
Method visit_or_pattern Undocumented
Method visit_overloaded_func_def Undocumented
Method visit_paramspec_expr Undocumented
Method visit_pass_stmt Undocumented
Method visit_raise_stmt Undocumented
Method visit_return_stmt Undocumented
Method visit_reveal_expr Undocumented
Method visit_sequence_pattern Undocumented
Method visit_set_comprehension Undocumented
Method visit_set_expr Undocumented
Method visit_singleton_pattern Undocumented
Method visit_slice_expr Undocumented
Method visit_star_expr Undocumented
Method visit_starred_pattern Undocumented
Method visit_str_expr Undocumented
Method visit_super_expr Undocumented
Method visit_temp_node Undocumented
Method visit_try_stmt Undocumented
Method visit_tuple_expr Undocumented
Method visit_type_alias_expr Undocumented
Method visit_type_application Undocumented
Method visit_type_var_expr Undocumented
Method visit_type_var_tuple_expr Undocumented
Method visit_typeddict_expr Undocumented
Method visit_unary_expr Undocumented
Method visit_value_pattern Undocumented
Method visit_var Undocumented
Method visit_while_stmt Undocumented
Method visit_with_stmt Undocumented
Method visit_yield_expr Undocumented
Method visit_yield_from_expr Undocumented
Instance Variable id_mapper Undocumented
Instance Variable show_ids Undocumented

Inherited from NodeVisitor:

Method visit_placeholder_node Undocumented
Method visit_type_alias Undocumented
def __init__(self, show_ids: bool = False): (source)

Undocumented

def dump(self, nodes: Sequence[object], obj: mypy.nodes.Context) -> str: (source)

Convert a list of items to a multiline pretty-printed string. The tag is produced from the type name of obj and its line number. See mypy.util.dump_tagged for a description of the nodes argument.

def format_id(self, o: object) -> str: (source)

Undocumented

def func_helper(self, o: mypy.nodes.FuncItem) -> list[object]: (source)

Return a list in a format suitable for dump() that represents the arguments and the body of a function. The caller can then decorate the array with information specific to methods, global functions or anonymous functions.

def get_id(self, o: object) -> int|None: (source)

Undocumented

def pretty_name(self, name: str, kind: int|None, fullname: str|None, is_inferred_def: bool, target_node: mypy.nodes.Node|None = None) -> str: (source)

Undocumented

def str_repr(self, s: str) -> str: (source)

Undocumented

def visit__promote_expr(self, o: mypy.nodes.PromoteExpr) -> str: (source)
def visit_as_pattern(self, o: mypy.patterns.AsPattern) -> str: (source)
def visit_assert_stmt(self, o: mypy.nodes.AssertStmt) -> str: (source)
def visit_assert_type_expr(self, o: mypy.nodes.AssertTypeExpr) -> str: (source)
def visit_assignment_expr(self, o: mypy.nodes.AssignmentExpr) -> str: (source)
def visit_assignment_stmt(self, o: mypy.nodes.AssignmentStmt) -> str: (source)
def visit_await_expr(self, o: mypy.nodes.AwaitExpr) -> str: (source)
def visit_block(self, o: mypy.nodes.Block) -> str: (source)

Undocumented

def visit_break_stmt(self, o: mypy.nodes.BreakStmt) -> str: (source)
def visit_bytes_expr(self, o: mypy.nodes.BytesExpr) -> str: (source)
def visit_call_expr(self, o: mypy.nodes.CallExpr) -> str: (source)
def visit_cast_expr(self, o: mypy.nodes.CastExpr) -> str: (source)
def visit_class_def(self, o: mypy.nodes.ClassDef) -> str: (source)
def visit_class_pattern(self, o: mypy.patterns.ClassPattern) -> str: (source)
def visit_comparison_expr(self, o: mypy.nodes.ComparisonExpr) -> str: (source)
def visit_complex_expr(self, o: mypy.nodes.ComplexExpr) -> str: (source)
def visit_conditional_expr(self, o: mypy.nodes.ConditionalExpr) -> str: (source)
def visit_continue_stmt(self, o: mypy.nodes.ContinueStmt) -> str: (source)
def visit_decorator(self, o: mypy.nodes.Decorator) -> str: (source)
def visit_del_stmt(self, o: mypy.nodes.DelStmt) -> str: (source)
def visit_dict_expr(self, o: mypy.nodes.DictExpr) -> str: (source)
def visit_dictionary_comprehension(self, o: mypy.nodes.DictionaryComprehension) -> str: (source)
def visit_ellipsis(self, o: mypy.nodes.EllipsisExpr) -> str: (source)
def visit_enum_call_expr(self, o: mypy.nodes.EnumCallExpr) -> str: (source)
def visit_expression_stmt(self, o: mypy.nodes.ExpressionStmt) -> str: (source)
def visit_float_expr(self, o: mypy.nodes.FloatExpr) -> str: (source)
def visit_for_stmt(self, o: mypy.nodes.ForStmt) -> str: (source)
def visit_func_def(self, o: mypy.nodes.FuncDef) -> str: (source)
def visit_generator_expr(self, o: mypy.nodes.GeneratorExpr) -> str: (source)
def visit_global_decl(self, o: mypy.nodes.GlobalDecl) -> str: (source)
def visit_if_stmt(self, o: mypy.nodes.IfStmt) -> str: (source)
def visit_import(self, o: mypy.nodes.Import) -> str: (source)

Undocumented

def visit_import_all(self, o: mypy.nodes.ImportAll) -> str: (source)
def visit_import_from(self, o: mypy.nodes.ImportFrom) -> str: (source)
def visit_index_expr(self, o: mypy.nodes.IndexExpr) -> str: (source)
def visit_int_expr(self, o: mypy.nodes.IntExpr) -> str: (source)
def visit_lambda_expr(self, o: mypy.nodes.LambdaExpr) -> str: (source)
def visit_list_comprehension(self, o: mypy.nodes.ListComprehension) -> str: (source)
def visit_list_expr(self, o: mypy.nodes.ListExpr) -> str: (source)
def visit_mapping_pattern(self, o: mypy.patterns.MappingPattern) -> str: (source)
def visit_match_stmt(self, o: mypy.nodes.MatchStmt) -> str: (source)
def visit_member_expr(self, o: mypy.nodes.MemberExpr) -> str: (source)
def visit_mypy_file(self, o: mypy.nodes.MypyFile) -> str: (source)
def visit_name_expr(self, o: mypy.nodes.NameExpr) -> str: (source)
def visit_namedtuple_expr(self, o: mypy.nodes.NamedTupleExpr) -> str: (source)
def visit_newtype_expr(self, o: mypy.nodes.NewTypeExpr) -> str: (source)
def visit_nonlocal_decl(self, o: mypy.nodes.NonlocalDecl) -> str: (source)
def visit_op_expr(self, o: mypy.nodes.OpExpr) -> str: (source)
def visit_operator_assignment_stmt(self, o: mypy.nodes.OperatorAssignmentStmt) -> str: (source)
def visit_or_pattern(self, o: mypy.patterns.OrPattern) -> str: (source)
def visit_overloaded_func_def(self, o: mypy.nodes.OverloadedFuncDef) -> str: (source)
def visit_paramspec_expr(self, o: mypy.nodes.ParamSpecExpr) -> str: (source)
def visit_pass_stmt(self, o: mypy.nodes.PassStmt) -> str: (source)
def visit_raise_stmt(self, o: mypy.nodes.RaiseStmt) -> str: (source)
def visit_return_stmt(self, o: mypy.nodes.ReturnStmt) -> str: (source)
def visit_reveal_expr(self, o: mypy.nodes.RevealExpr) -> str: (source)
def visit_sequence_pattern(self, o: mypy.patterns.SequencePattern) -> str: (source)
def visit_set_comprehension(self, o: mypy.nodes.SetComprehension) -> str: (source)
def visit_set_expr(self, o: mypy.nodes.SetExpr) -> str: (source)
def visit_singleton_pattern(self, o: mypy.patterns.SingletonPattern) -> str: (source)
def visit_slice_expr(self, o: mypy.nodes.SliceExpr) -> str: (source)
def visit_star_expr(self, o: mypy.nodes.StarExpr) -> str: (source)
def visit_starred_pattern(self, o: mypy.patterns.StarredPattern) -> str: (source)
def visit_str_expr(self, o: mypy.nodes.StrExpr) -> str: (source)
def visit_super_expr(self, o: mypy.nodes.SuperExpr) -> str: (source)
def visit_temp_node(self, o: mypy.nodes.TempNode) -> str: (source)
def visit_try_stmt(self, o: mypy.nodes.TryStmt) -> str: (source)
def visit_tuple_expr(self, o: mypy.nodes.TupleExpr) -> str: (source)
def visit_type_alias_expr(self, o: mypy.nodes.TypeAliasExpr) -> str: (source)
def visit_type_application(self, o: mypy.nodes.TypeApplication) -> str: (source)
def visit_type_var_expr(self, o: mypy.nodes.TypeVarExpr) -> str: (source)
def visit_type_var_tuple_expr(self, o: mypy.nodes.TypeVarTupleExpr) -> str: (source)
def visit_typeddict_expr(self, o: mypy.nodes.TypedDictExpr) -> str: (source)
def visit_unary_expr(self, o: mypy.nodes.UnaryExpr) -> str: (source)
def visit_value_pattern(self, o: mypy.patterns.ValuePattern) -> str: (source)
def visit_var(self, o: mypy.nodes.Var) -> str: (source)

Undocumented

def visit_while_stmt(self, o: mypy.nodes.WhileStmt) -> str: (source)
def visit_with_stmt(self, o: mypy.nodes.WithStmt) -> str: (source)
def visit_yield_expr(self, o: mypy.nodes.YieldExpr) -> str: (source)
def visit_yield_from_expr(self, o: mypy.nodes.YieldFromExpr) -> str: (source)
id_mapper = (source)

Undocumented

show_ids = (source)

Undocumented