MCPcopy Index your code
hub / github.com/python/mypy / load_tree

Function load_tree

mypy/test/test_nativeparse.py:126–135  ·  view source on GitHub ↗

Deserialize full AST from serialized raw data.

(node: MypyFile, options: Options)

Source from the content-addressed store, hash-verified

124
125
126def load_tree(node: MypyFile, options: Options) -> list[ParseError]:
127 """Deserialize full AST from serialized raw data."""
128 assert node.raw_data is not None
129 state = State(options)
130 data = ReadBuffer(node.raw_data.defs)
131 n = read_int(data)
132 node.defs = read_statements(state, data, n)
133 node.imports = deserialize_imports(node.raw_data.imports)
134 node.raw_data = None
135 return state.errors
136
137
138def test_parser_imports(testcase: DataDrivenTestCase) -> None:

Callers 2

test_parserFunction · 0.85
test_parser_importsFunction · 0.85

Calls 4

StateClass · 0.90
read_intFunction · 0.90
read_statementsFunction · 0.90
deserialize_importsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…