Re: [Python-ideas] Auto-wrapping coroutines into Tasks

2018-05-04 Thread Nathaniel Smith
On Fri, May 4, 2018 at 2:58 PM, Guido van Rossum wrote: > First, "start executing immediately" is an overstatement, right? They won't > run until the caller executes a (possibly unrelated) `await`. Well, traditional Future-returning functions often do execute some logic immediately, but right, wh

Re: [Python-ideas] Auto-wrapping coroutines into Tasks

2018-05-04 Thread Guido van Rossum
First, "start executing immediately" is an overstatement, right? They won't run until the caller executes a (possibly unrelated) `await`. And I'm still unclear why anyone would care, *except* in the case where they've somehow learned by observation that "real" coroutines don't start immediately and

[Python-ideas] Auto-wrapping coroutines into Tasks

2018-05-04 Thread Nathaniel Smith
Hi all, This is a bit of a wacky idea, but I think it might be doable and have significant benefits, so throwing it out there to see what people think. In asyncio, there are currently three kinds of calling conventions for asynchronous functions: 1) Ones which return a Future 2) Ones which retur