curio/task.py
async def next_done(self):
        '''
        Wait for the next task to finish and return it.  This removes it
        from the group.
        '''
        while not self._finished and self._running:
            await self._sema.acquire()

        if self._finished:
            task = self._finished.popleft()
            await task.wait()
            task.taskgroup = None
            self._tasks.discard(task)
        else:
            task = None

        return task

        Wait for the next task to finish and return it.  This removes it
        from the group.
        
Wait for the next task to finish and return it.  This removes it
from the group.
Wait for the next task to finish and return it . This removes it from the group .
async def next_done(self):
        while not self._finished and self._running:
            await self._sema.acquire()
        if self._finished:
            task = self._finished.popleft()
            await task.wait()
            task.taskgroup = None
            self._tasks.discard(task)
        else:
            task = None
        return task
async def next_done ( self ) : while not self . _finished and self . _running : await self . _sema . acquire ( ) if self . _finished : task = self . _finished . popleft ( ) await task . wait ( ) task . taskgroup = None self . _tasks . discard ( task ) else : task = None return task
Wait for the next task to finish and return it.
Wait for the next task to finish and return it .
'''
        Wait for the next task to finish and return it.  This removes it
        from the group.
        '''
self