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

Function order_ascc_ex

mypy/build.py:4429–4449  ·  view source on GitHub ↗

Apply extra heuristics on top of order_ascc(). This should be used only for actual SCCs, not for "inner" SCCs we create recursively during ordering of the SCC. Currently, this has only some special handling for builtin SCC.

(graph: Graph, ascc: SCC)

Source from the content-addressed store, hash-verified

4427
4428
4429def order_ascc_ex(graph: Graph, ascc: SCC) -> list[str]:
4430 """Apply extra heuristics on top of order_ascc().
4431
4432 This should be used only for actual SCCs, not for "inner" SCCs
4433 we create recursively during ordering of the SCC. Currently, this
4434 has only some special handling for builtin SCC.
4435 """
4436 scc = order_ascc(graph, ascc.mod_ids)
4437 # Make the order of the SCC that includes 'builtins' and 'typing',
4438 # among other things, predictable. Various things may break if
4439 # the order changes.
4440 if "builtins" in ascc.mod_ids:
4441 scc = sorted(scc, reverse=True)
4442 # If builtins is in the list, move it last. (This is a bit of
4443 # a hack, but it's necessary because the builtins module is
4444 # part of a small cycle involving at least {builtins, abc,
4445 # typing}. Of these, builtins must be processed last or else
4446 # some builtin objects will be incompletely processed.)
4447 scc.remove("builtins")
4448 scc.append("builtins")
4449 return scc
4450
4451
4452def verify_transitive_deps(ascc: SCC, graph: Graph, manager: BuildManager) -> str | None:

Callers 3

find_stale_sccsFunction · 0.85
process_stale_sccFunction · 0.85

Calls 4

order_asccFunction · 0.85
sortedFunction · 0.85
appendMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…