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

Function free_tree

mypy/freetree.py:15–23  ·  view source on GitHub ↗

Free all the ASTs associated with a module. This needs to be done recursively, since symbol tables contain references to definitions, so those won't be freed but we want their contents to be.

(tree: MypyFile)

Source from the content-addressed store, hash-verified

13
14
15def free_tree(tree: MypyFile) -> None:
16 """Free all the ASTs associated with a module.
17
18 This needs to be done recursively, since symbol tables contain
19 references to definitions, so those won't be freed but we want their
20 contents to be.
21 """
22 tree.accept(TreeFreer())
23 tree.defs.clear()

Callers 1

finish_passesMethod · 0.90

Calls 3

TreeFreerClass · 0.85
acceptMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…