Skip to content

Commit

Permalink
bpo-42588: Update the docs for the TopologicalSorter.static_order() m…
Browse files Browse the repository at this point in the history
…ethod (GH-26834) (GH-26952)

(cherry picked from commit 0d7f797)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
  • Loading branch information
miss-islington and akulakov committed Jun 29, 2021
1 parent 0787a1b commit 3ba65cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Doc/library/graphlib.rst
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.

0 comments on commit 3ba65cd

Please sign in to comment.