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 curtmcd
Recipients curtmcd, gvanrossum, mathieui, vstinner, yselivanov
Date 2017-06-09.01:12:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496970733.02.0.132397672721.issue23519@psf.upfronthosting.co.za>
In-reply-to
Content
There are use cases for this. I hit the problem and eventually wound up here, so I'd like to make a case to re-open.

My project has a callback registry of asyncio handler routines.

register_callback(condition1, handler1)
register_callback(condition2, handler2)
...

I want to register many callbacks, but use only one handler and an argument to differentiate it. I realize our callback systems should provide for a cookie, but it doesn't. 

register_callback(condition1, functools.partial(handler, 'detail1'))
register_callback(condition2, functools.partial(handler, 'detail2'))

The callback registry makes sure iscoroutinefunction(handler) because we don't want to defer error checking to the distant future. But iscoroutinefunction() returns False for the partial function. I was hopeful that this might work, but alas, no:

register_callback(condition1,
                  asyncio.coroutine(functools.partial(handler, 'detail1')))
History
Date User Action Args
2017-06-09 01:12:13curtmcdsetrecipients: + curtmcd, gvanrossum, vstinner, mathieui, yselivanov
2017-06-09 01:12:13curtmcdsetmessageid: <1496970733.02.0.132397672721.issue23519@psf.upfronthosting.co.za>
2017-06-09 01:12:12curtmcdlinkissue23519 messages
2017-06-09 01:12:12curtmcdcreate