PyDocs

Nav

Data Types

TopologicalSorter.prepare

  • TopologicalSorter.prepare()
Mark the graph as finished and check for cycles in the graph.

If any cycle is detected, "CycleError" will be raised, but "get_ready" can
still be used to obtain as many nodes as possible until cycles block more
progress. After a call to this function, the graph cannot be modified and
therefore no more nodes can be added using "add".

Raise ValueError if nodes have already been passed out of the sorter.
Changed in 3.14
  • 3.14: prepare() can now be called more than once as long as the sort has not started. Previously this raised ValueError.
0 Examples
No examples for graphlib/TopologicalSorter.prepare.
See Also
No see-alsos for graphlib/TopologicalSorter.prepare
0 Notes
No notes for TopologicalSorter.prepare