From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:19:05 +0000 (-0700) Subject: bpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834... X-Git-Tag: v3.9.7~185 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ba65cdcefcec7866be482138a5ea8aafbd07e59;p=thirdparty%2FPython%2Fcpython.git bpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834) (GH-26952) (cherry picked from commit 0d7f7975d55eff7e3dfcebd14e765fc6cd7d3e40) Co-authored-by: andrei kulakov Co-authored-by: andrei kulakov --- diff --git a/Doc/library/graphlib.rst b/Doc/library/graphlib.rst index 0faca2186b26..2bc80da4ead2 100644 --- a/Doc/library/graphlib.rst +++ b/Doc/library/graphlib.rst @@ -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() @@ -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. \ No newline at end of file + the first and the last node will be the same, to make it clear that it is cyclic.