30 Nov
2012
30 Nov
'12
10:55 p.m.
On Fri, Nov 30, 2012 at 2:37 PM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Guido van Rossum wrote:
Futures or callbacks, that's the question...
Richard and I have even been considering APIs like this:
res = obj.some_call(<args>) if isinstance(res, Future): res = yield res
I thought you had decided against the idea of yielding futures?
As a user-facing API style, yes. But this is meant for an internal API -- the equivalent of your bare 'yield'. If you want to, I can consider another style as well res = obj.some_call(<args>) if isinstance(res, Future): res.<magic_call>() yield But I don't see a fundamental advantage to this. -- --Guido van Rossum (python.org/~guido)