MCPcopy
hub / github.com/python/mypy / dump

Method dump

mypy/strconv.py:57–68  ·  view source on GitHub ↗

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.

(self, nodes: Sequence[object], obj: mypy.nodes.Context)

Source from the content-addressed store, hash-verified

55 return ""
56
57 def dump(self, nodes: Sequence[object], obj: mypy.nodes.Context) -> str:
58 """Convert a list of items to a multiline pretty-printed string.
59
60 The tag is produced from the type name of obj and its line
61 number. See mypy.util.dump_tagged for a description of the nodes
62 argument.
63 """
64 tag = short_type(obj) + ":" + str(obj.line)
65 if self.show_ids:
66 assert self.id_mapper is not None
67 tag += f"<{self.get_id(obj)}>"
68 return dump_tagged(nodes, tag, self)
69
70 def func_helper(self, o: mypy.nodes.FuncItem) -> list[object]:
71 """Return a list in a format suitable for dump() that represents the

Callers 15

visit_mypy_fileMethod · 0.95
visit_func_defMethod · 0.95
visit_class_defMethod · 0.95
visit_global_declMethod · 0.95
visit_nonlocal_declMethod · 0.95
visit_decoratorMethod · 0.95
visit_type_aliasMethod · 0.95
visit_blockMethod · 0.95
visit_expression_stmtMethod · 0.95
visit_assignment_stmtMethod · 0.95

Calls 4

get_idMethod · 0.95
short_typeFunction · 0.90
strClass · 0.85
dump_taggedFunction · 0.85

Tested by

no test coverage detected