(fs, *, timeout=None, return_when=ALL_COMPLETED)
return await _wait(fs, timeout, return_when, loop)
Wait for the Futures and coroutines given by fs to complete.

    The fs iterable must not be empty.

    Coroutines will be wrapped in Tasks.

    Returns two sets of Future: (done, pending).

    Usage:

        done, pending = await asyncio.wait(fs)

    Note: This does not raise TimeoutError! Futures that aren't done
    when the timeout occurs are returned in the second set.
Wait for the Futures and coroutines given by fs to complete.
Wait for the Futures and coroutines given by fs to complete .
async def wait(fs, *, timeout=None, return_when=ALL_COMPLETED):
    """Wait for the Futures and coroutines given by fs to complete.

    The fs iterable must not be empty.

    Coroutines will be wrapped in Tasks.

    Returns two sets of Future: (done, pending).

    Usage:

        done, pending = await asyncio.wait(fs)

    Note: This does not raise TimeoutError! Futures that aren't done
    when the timeout occurs are returned in the second set.
    """
    if futures.isfuture(fs) or coroutines.iscoroutine(fs):
        raise TypeError(f"expect a list of futures, not {type(fs).__name__}")
    if not fs:
        raise ValueError('Set of coroutines/Futures is empty.')
    if return_when not in (FIRST_COMPLETED, FIRST_EXCEPTION, ALL_COMPLETED):
        raise ValueError(f'Invalid return_when value: {return_when}')

    loop = events.get_running_loop()

    fs = set(fs)

    if any(coroutines.iscoroutine(f) for f in fs):
        warnings.warn("The explicit passing of coroutine objects to "
                      "asyncio.wait() is deprecated since Python 3.8, and "
                      "scheduled for removal in Python 3.11.",
                      DeprecationWarning, stacklevel=2)

    fs = {ensure_future(f, loop=loop) for f in fs}

    return await _wait(fs, timeout, return_when, loop)
async def wait ( fs , * , timeout = None , return_when = ALL_COMPLETED ) : if futures . isfuture ( fs ) or coroutines . iscoroutine ( fs ) : raise TypeError ( f"expect a list of futures, not {type(fs).__name__}" ) if not fs : raise ValueError ( 'Set of coroutines/Futures is empty.' ) if return_when not in ( FIRST_COMPLETED , FIRST_EXCEPTION , ALL_COMPLETED ) : raise ValueError ( f'Invalid return_when value: {return_when}' ) loop = events . get_running_loop ( ) fs = set ( fs ) if any ( coroutines . iscoroutine ( f ) for f in fs ) : warnings . warn ( "The explicit passing of coroutine objects to " "asyncio.wait() is deprecated since Python 3.8, and " "scheduled for removal in Python 3.11." , DeprecationWarning , stacklevel = 2 ) fs = { ensure_future ( f , loop = loop ) for f in fs } return await _wait ( fs , timeout , return_when , loop )