This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients rhettinger
Date 2013-01-20.21:39:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I suggest adding a topological sort algorithm to the standard library.

In addition to being a fundamental algorithm, it is immediately useful in demonstrating how the MRO computation works and for pure Python implementations of MRO logic.   IIRC, the pgen code was also expressed in pure Python for the same reason.

I've attached a first-draft of the algorithm and an alternative that only implements a topological merge.  This is just an early draft and there are a number of open points:

* which module to put it in
* a better implementation may be possible (perhaps using fewer dictionaries and sets).
Date User Action Args
2013-01-20 21:39:12rhettingersetrecipients: + rhettinger
2013-01-20 21:39:12rhettingersetmessageid: <>
2013-01-20 21:39:12rhettingerlinkissue17005 messages
2013-01-20 21:39:12rhettingercreate