Skip to content

Commit f6596ff

Browse files
committed
compute_topological_order: back to CanLt[Any], with explanation
1 parent edb39f5 commit f6596ff

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pytools/graph.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ def __lt__(self, other: _HeapEntry[NodeT]) -> bool:
281281

282282
def compute_topological_order(
283283
graph: GraphT[NodeT],
284+
# should not use CanLt[object] because many types can't compare against
285+
# everything under the sun
284286
key: Callable[[NodeT], optype.CanLt[Any]] | None = None,
285287
) -> list[NodeT]:
286288
"""Compute a topological order of nodes in a directed graph.

0 commit comments

Comments
 (0)