PyDocs

Nav

Data Types

TopologicalSorter.add

  • TopologicalSorter.add(node, *predecessors)
Add a new node and its predecessors to the graph.

Both the *node* and all elements in *predecessors* must be hashable.

If called multiple times with the same node argument, the set of dependencies
will be the union of all dependencies passed in.

It is possible to add a node with no dependencies (*predecessors* is not provided)
as well as provide a dependency twice. If a node that has not been provided before
is included among *predecessors* it will be automatically added to the graph with
no predecessors of its own.

Raises ValueError if called after "prepare".
0 Examples
No examples for graphlib/TopologicalSorter.add.
See Also
No see-alsos for graphlib/TopologicalSorter.add
0 Notes
No notes for TopologicalSorter.add