Message236668
| 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: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 |
|