STINNER Victor <vstin...@redhat.com> added the comment:

FYI if I recall correctly, in the past, we preferred to pass explicitly the 
loop to avoid to have to get the current loop which may add an overhead. But 
the current trend is to get rid of the explicit loop parameter.

> asyncio.sleep is a coroutine; passing a *loop* argument to it makes no sense 
> anymore.

sleep() requires the current event loop:

    if loop is None:
        loop = events.get_running_loop()
    else:
        warnings.warn("The loop argument is deprecated and scheduled for "
                      "removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)

    future = loop.create_future()
    h = loop.call_later(delay,
                        futures._set_result_unless_cancelled,
                        future, result)

Why does it not make sense to pass the loop to sleep? "it makes no sense 
anymore" something changes?

I'm not against the change, I'm just trying to understand the rationale for 
other changes :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34728>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to