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 mathieui
Recipients gvanrossum, mathieui, vstinner, yselivanov
Date 2015-02-26.13:26:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424957180.08.0.246914563809.issue23519@psf.upfronthosting.co.za>
In-reply-to
Content
Using functools.partial with coroutines would be mostly out of convenience, in order to avoid having factories in that return parametrized coroutine functions. I guess in such cases it might be better to create a two-lines wrapper around partial() to make it return a coroutine rather than change the stdlib for that.

In the attached file is an example of such use, where EventNotifier is a Protocol which receives external events and triggers event handlers based on that, and where the add_event_handler function checks if the handler is a coroutine function. In which case it uses asyncio.async to schedule the handler call; otherwise it uses loop.call_soon.

You can close this, I guess.
History
Date User Action Args
2015-02-26 13:26:20mathieuisetrecipients: + mathieui, gvanrossum, vstinner, yselivanov
2015-02-26 13:26:20mathieuisetmessageid: <1424957180.08.0.246914563809.issue23519@psf.upfronthosting.co.za>
2015-02-26 13:26:20mathieuilinkissue23519 messages
2015-02-26 13:26:19mathieuicreate