Author rhettinger
Recipients rhettinger
Date 2013-01-20.21:39:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2013-01-20 21:39:12rhettingersetrecipients: + rhettinger
2013-01-20 21:39:12rhettingersetmessageid: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za>
2013-01-20 21:39:12rhettingerlinkissue17005 messages
2013-01-20 21:39:12rhettingercreate