[python-tulip] asyncio.iscoroutinefunction and partials

2015-02-16 Thread Ron Cohen
Hey! In APIs that take a coroutine callbacks as a parameter, one would like to make sure the callback given is in fact a coroutine. Partials are of course useful in this scenario. It occurs to me that `asyncio.iscoroutinefunction` should know about coroutines wrapped in partials: import

Re: [python-tulip] asyncio.iscoroutinefunction and partials

2015-02-16 Thread Guido van Rossum
Usually you shouldn't be checking for couroutine functions directly. There are too many cases where something returns in fact a coroutine but you cannot tell by inspecting the thing you call -- you can only tell once you've called it (using iscoroutine()). Partials are just one approach -- lambdas