This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients asvetlov, fbidu, serhiy.storchaka, vstinner, willingc, xtreak, yselivanov
Date 2018-10-02.07:44:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538466272.4.0.545547206417.issue34728@psf.upfronthosting.co.za>
In-reply-to
Content
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 :-)
History
Date User Action Args
2018-10-02 07:44:32vstinnersetrecipients: + vstinner, asvetlov, serhiy.storchaka, yselivanov, willingc, xtreak, fbidu
2018-10-02 07:44:32vstinnersetmessageid: <1538466272.4.0.545547206417.issue34728@psf.upfronthosting.co.za>
2018-10-02 07:44:32vstinnerlinkissue34728 messages
2018-10-02 07:44:32vstinnercreate