Skip to content

Commit 89d07ce

Browse files
committed
fixup! Document CycleError
1 parent 81c1833 commit 89d07ce

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/functools.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,15 @@ def __init__(self, node):
219219

220220

221221
class CycleError(ValueError):
222+
"""Subclass of ValueError raised by TopologicalSorterif cycles exist in the graph
223+
224+
If multiple cycles exist, only one undefined choice among them will be reported
225+
and included in the exception. The detected cycle can be accessed via the second
226+
element in the *args* attribute of the exception instance and consists in a list
227+
of nodes, such that each node is, in the graph, an immediate predecessor of the
228+
next node in the list. In the reported list, the first and the last node will be
229+
the same, to make it clear that it is cyclic.
230+
"""
222231
pass
223232

224233

0 commit comments

Comments
 (0)