File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -679,7 +679,7 @@ The :mod:`functools` module defines the following functions:
679
679
yield from node_group
680
680
self.done(*node_group)
681
681
682
- The particular order that is returned may depend on the particular order in
682
+ The particular order that is returned may depend on the specific order in
683
683
which the items were inserted in the graph. For example:
684
684
685
685
.. doctest ::
Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ def _find_cycle(self):
415
415
def static_order (self ):
416
416
"""Returns an iterable of nodes in a topological order.
417
417
418
- The particular order that is returned may depend on the particular
418
+ The particular order that is returned may depend on the specific
419
419
order in which the items were inserted in the graph.
420
420
421
421
Using this method does not require to call "prepare" or "done". If any
Original file line number Diff line number Diff line change @@ -1384,9 +1384,8 @@ def get_groups(ts):
1384
1384
ts .prepare ()
1385
1385
while ts .is_active ():
1386
1386
nodes = ts .get_ready ()
1387
- for node in nodes :
1388
- ts .done (node )
1389
- yield nodes
1387
+ ts .done (* nodes )
1388
+ yield set (nodes )
1390
1389
1391
1390
ts = functools .TopologicalSorter ()
1392
1391
ts .add (3 , 2 , 1 )
@@ -1402,10 +1401,7 @@ def get_groups(ts):
1402
1401
ts2 .add (6 , 7 )
1403
1402
ts2 .add (4 , 5 )
1404
1403
1405
- self .assertEqual (
1406
- list (map (set , get_groups (ts ))),
1407
- list (map (set , get_groups (ts2 )))
1408
- )
1404
+ self .assertEqual (list (get_groups (ts )), list (get_groups (ts2 )))
1409
1405
1410
1406
def test_static_order_does_not_change_with_the_hash_seed (self ):
1411
1407
def check_order_with_hash_seed (seed ):
You can’t perform that action at this time.
0 commit comments