Skip to content

bpo-42588: Update static_order method docs #26834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Doc/library/graphlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@

.. method:: static_order()

Returns an iterable of nodes in a topological order. Using this method
does not require to call :meth:`TopologicalSorter.prepare` or
:meth:`TopologicalSorter.done`. This method is equivalent to::
Returns an iterator object which will iterate over nodes in a topological
order. When using this method, :meth:`~TopologicalSorter.prepare` and
:meth:`~TopologicalSorter.done` should not be called. This method is
equivalent to::

def static_order(self):
self.prepare()
Expand Down Expand Up @@ -206,4 +207,4 @@ The :mod:`graphlib` module defines the following exception classes:
The detected cycle can be accessed via the second element in the :attr:`~CycleError.args`
attribute of the exception instance and consists in a list of nodes, such that each node is,
in the graph, an immediate predecessor of the next node in the list. In the reported list,
the first and the last node will be the same, to make it clear that it is cyclic.
the first and the last node will be the same, to make it clear that it is cyclic.