Example #1
0
def test_separate1():
    a, b = separate(range(5), key=lambda n: n < 3)
    assert a == [0, 1, 2]
    assert b == [3, 4]
Example #2
0
def test_separate2():
    a, b = separate(range(5))
    assert a == [1, 2, 3, 4]
    assert b == [0]
Example #3
0
 def iter_handlers_by_priority(self):
     for k in PRIORITIES:
         yield separate(self.handlers[k], lambda h: h.asynchronous)