Message180319
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:12 | rhettinger | set | recipients:
+ rhettinger |
2013-01-20 21:39:12 | rhettinger | set | messageid: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za> |
2013-01-20 21:39:12 | rhettinger | link | issue17005 messages |
2013-01-20 21:39:12 | rhettinger | create | |
|