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 Paddy McCarthy Jim Fasarakis-Hilliard, Paddy McCarthy, Zahari.Dim, belopolsky, christian.heimes, eric.smith, gaborjbernat, gdr@garethrees.org, lukasz.langa, maresb, martin.panter, miss-islington, orsenthil, pablogsal, remi.lapeyre, rhettinger, terry.reedy, tim.peters, tshepang, vstinner, wim.glenn 2020-08-27.02:01:54 -1.0 Yes <1598493715.04.0.06462575371.issue17005@roundup.psfhosted.org>
Content
```I've been playing with Python 3.9.0rc1 and was looking at a particular graph to see when it released tasks for processing.
I ran the following code:

from functools import reduce
from pprint import pprint as pp
from collections import defaultdict
from graphlib import TopologicalSorter
from heapq import heapify, heappush, heappop, heappushpop

print("""
###
###

A -> B -> C
↓    ↓    ↓
D -> E -> F
""")
graph3 = {"A": {"B", "D"},
"B": {"C", "E"},
"C": {"F"},
"D": {"E"},
"E": {"F"},
}

print("\n## NEW SIMULATION")
t = 0
heap = []
heapify(heap)
print(f"  {node}: {tm}")

print("\n# OUTPUT. (:> for task start times, <: for stop times).\n")
ts = TopologicalSorter(graph)
ts.prepare()
while ts.is_active():
heappush(heap, (finish, node))
print(f"{'  ' * t}{node}:> @{t}")
t, node = heappop(heap)
print(f"{'  ' * t}{node}<: @{t}")
ts.done(node)

I got the following output:

###
###

A -> B -> C
↓    ↓    ↓
D -> E -> F

## NEW SIMULATION

A: 2
B: 2
C: 2
D: 2
E: 2
F: 2

# OUTPUT. (:> for task start times, <: for stop times).

F:> @0
F<: @2
C:> @2
E:> @2
C<: @4
E<: @4
B:> @4
D:> @4
B<: @6
D<: @6
A:> @6
A<: @8

## NEW SIMULATION

A: 2
B: 2
C: 1
D: 2
E: 2
F: 2

# OUTPUT. (:> for task start times, <: for stop times).

F:> @0
F<: @2
C:> @2
E:> @2
C<: @3
E<: @4
B:> @4
D:> @4
B<: @6
D<: @6
A:> @6
A<: @8
>>>

Note that in the second simulation, C finish, but B isn't then immediately started. I have my own code that also works like this but it isn't optimal.

Thanks guys.```
History
Date User Action Args
2020-08-27 02:01:55Paddy McCarthysetrecipients: + Paddy McCarthy, tim.peters, rhettinger, terry.reedy, belopolsky, orsenthil, vstinner, eric.smith, christian.heimes, lukasz.langa, tshepang, gdr@garethrees.org, martin.panter, wim.glenn, Zahari.Dim, Jim Fasarakis-Hilliard, pablogsal, miss-islington, remi.lapeyre, gaborjbernat, maresb