[issue17005] Add a topological sort algorithm

Pablo Galindo Salgado report at bugs.python.org
Tue Jan 14 20:24:19 EST 2020


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> Am I seriously suggesting this for Python?  Sure.  It's fun to advance the practical state of the art :-)


I think this API looks very interesting! I have some questions before start implementing it to play a bit with it:

- I am slightly confused about what .prepare() should do. Why is this step necessary?

- Why we need the .done() method here? Why not instead make get_ready() simply a generator so you can just write

    for node in self.get_ready():

It seems that the .done() is very tight to use this API as a "task scheduler" but maybe I am doing something here in
my understanding of the API.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17005>
_______________________________________


More information about the Python-bugs-list mailing list