def _run_wakers(wakers: list, *args): # Python doesn't have `.retain()` :( index = 0 for waker in wakers: if waker(*args): wakers[index] = waker index += 1 del wakers[index:]
https://files.mastodon.social/media_attachments/files/112/387/363/536/884/621/original/2116472af4197bf1.png