MCPcopy
hub / github.com/Textualize/textual / count_nodes

Function count_nodes

tests/test_gc.py:11–19  ·  view source on GitHub ↗

Count number of references to DOMNodes.

()

Source from the content-addressed store, hash-verified

9
10
11def count_nodes() -> int:
12 """Count number of references to DOMNodes."""
13 dom_nodes = [
14 obj
15 for obj in gc.get_objects()
16 if any(cls.__name__ == "DOMNode" for cls in obj.__class__.__mro__)
17 ]
18 print(dom_nodes)
19 return len(dom_nodes)
20
21
22async def run_app() -> None:

Callers 2

run_appFunction · 0.85
_count_app_nodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…