Message236668
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. |
|
Date |
User |
Action |
Args |
2015-02-26 13:26:20 | mathieui | set | recipients:
+ mathieui, gvanrossum, vstinner, yselivanov |
2015-02-26 13:26:20 | mathieui | set | messageid: <1424957180.08.0.246914563809.issue23519@psf.upfronthosting.co.za> |
2015-02-26 13:26:20 | mathieui | link | issue23519 messages |
2015-02-26 13:26:19 | mathieui | create | |
|