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

Class NodeInfo

mypy/build.py:4175–4193  ·  view source on GitHub ↗

Some info about a node in the graph of SCCs.

Source from the content-addressed store, hash-verified

4173
4174
4175class NodeInfo:
4176 """Some info about a node in the graph of SCCs."""
4177
4178 def __init__(self, index: int, scc: list[str]) -> None:
4179 self.node_id = "n%d" % index
4180 self.scc = scc
4181 self.sizes: dict[str, int] = {} # mod -> size in bytes
4182 self.deps: dict[str, int] = {} # node_id -> pri
4183
4184 def dumps(self) -> str:
4185 """Convert to JSON string."""
4186 total_size = sum(self.sizes.values())
4187 return "[{}, {}, {},\n {},\n {}]".format(
4188 json.dumps(self.node_id),
4189 json.dumps(total_size),
4190 json.dumps(self.scc),
4191 json.dumps(self.sizes),
4192 json.dumps(self.deps),
4193 )
4194
4195
4196def dump_timing_stats(path: str, graph: Graph) -> None:

Callers 1

dump_graphFunction · 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…