Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 4:36 PM, Rustom Mody rustompm...@gmail.com wrote: On Friday, May 8, 2015 at 10:39:38 AM UTC+5:30, Chris Angelico wrote: Why have the concept of a procedure? On Friday, Chris Angelico ALSO wrote: With print(), you have a conceptual procedure... So which do you want to

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-08 Thread Rustom Mody
On Friday, May 8, 2015 at 10:39:38 AM UTC+5:30, Chris Angelico wrote: Why have the concept of a procedure? On Friday, Chris Angelico ALSO wrote: With print(), you have a conceptual procedure... So which do you want to stand by? Just to be clear I am not saying python should be any different

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 9:53 PM, Dave Angel da...@davea.name wrote: One thing newbies get tripped up by is having some path through their code that doesn't explicitly return. And in Python that path therefore returns None. It's most commonly confusing when there are nested ifs, and one of the

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-08 Thread Dave Angel
On 05/08/2015 02:42 AM, Chris Angelico wrote: On Fri, May 8, 2015 at 4:36 PM, Rustom Mody rustompm...@gmail.com wrote: On Friday, May 8, 2015 at 10:39:38 AM UTC+5:30, Chris Angelico wrote: Why have the concept of a procedure? On Friday, Chris Angelico ALSO wrote: With print(), you have a

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-07 Thread Chris Angelico
On Fri, May 8, 2015 at 2:53 PM, Rustom Mody rustompm...@gmail.com wrote: Yeah I know And if python did not try to be so clever, I'd save some time with student-surprises In a program, an expression statement simply discards its result, whether it's None or 42 or [1,2,3] or anything else.

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-07 Thread Rustom Mody
On Wednesday, May 6, 2015 at 11:19:07 AM UTC+5:30, Steven D'Aprano wrote: On Wednesday 06 May 2015 14:47, Rustom Mody wrote: It strikes me that the FP crowd has stretched the notion of function beyond recognition And the imperative/OO folks have distorted it beyond redemption. In what

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-07 Thread Chris Angelico
On Fri, May 8, 2015 at 2:06 PM, Rustom Mody rustompm...@gmail.com wrote: If the classic Pascal (or Fortran or Basic) sibling balanced abstractions of function-for-value procedure-for-effect were more in the collective consciousness rather than C's travesty of function, things might not have

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-07 Thread Rustom Mody
On Friday, May 8, 2015 at 10:24:06 AM UTC+5:30, Rustom Mody wrote: get is very much a function and the None return is semantically significant. print is just round peg -- what you call conceptual function -- stuffed into square hole -- function the only available syntax-category Sorry

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-07 Thread Rustom Mody
On Wednesday, May 6, 2015 at 6:41:38 PM UTC+5:30, Dennis Lee Bieber wrote: On Tue, 5 May 2015 21:47:17 -0700 (PDT), Rustom Mody declaimed the following: If the classic Pascal (or Fortran or Basic) sibling balanced abstractions of function-for-value procedure-for-effect were more in the

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-07 Thread Rustom Mody
On Friday, May 8, 2015 at 10:04:02 AM UTC+5:30, Chris Angelico wrote: On Fri, May 8, 2015 at 2:06 PM, Rustom Mody wrote: If the classic Pascal (or Fortran or Basic) sibling balanced abstractions of function-for-value procedure-for-effect were more in the collective consciousness rather

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Rustom Mody
On Tuesday, May 5, 2015 at 11:15:42 PM UTC+5:30, Marko Rauhamaa wrote: Personally, I have never found futures a very useful idiom in any language (Scheme, Java, Python). Or more to the point, concurrency and the notion of a function don't gel well in my mind. Interesting comment. It strikes

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Steven D'Aprano
On Wednesday 06 May 2015 14:47, Rustom Mody wrote: It strikes me that the FP crowd has stretched the notion of function beyond recognition And the imperative/OO folks have distorted it beyond redemption. In what way? And the middle road shown by Pascal has been overgrown with weeds for

asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Paul Moore
I'm working my way through the asyncio documentation. I have got to the Tasks and coroutines section, but I'm frankly confused as to the difference between the various things described in that section: coroutines, tasks, and futures. I think can understand a coroutine. Correct me if I'm wrong,

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Terry Reedy
On 5/5/2015 1:46 PM, Ian Kelly wrote: On Tue, May 5, 2015 at 9:22 AM, Paul Moore p.f.mo...@gmail.com wrote: I'm working my way through the asyncio documentation. I have got to the Tasks and coroutines section, but I'm frankly confused as to the difference between the various things described

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Ian Kelly
On Tue, May 5, 2015 at 9:22 AM, Paul Moore p.f.mo...@gmail.com wrote: I'm working my way through the asyncio documentation. I have got to the Tasks and coroutines section, but I'm frankly confused as to the difference between the various things described in that section: coroutines, tasks,

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Paul Moore
On Tuesday, 5 May 2015 18:48:09 UTC+1, Ian wrote: Fundamentally, a future is a placeholder for something that isn't available yet. You can use it to set a callback to be called when that thing is available, and once it's available you can get that thing from it. OK, that makes a lot of

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Zachary Ware
On Tue, May 5, 2015 at 10:22 AM, Paul Moore p.f.mo...@gmail.com wrote: I'm working my way through the asyncio documentation. I have got to the Tasks and coroutines section, but I'm frankly confused as to the difference between the various things described in that section: coroutines, tasks,

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Terry Reedy
On 5/5/2015 11:22 AM, Paul Moore wrote: I'm working my way through the asyncio documentation. I have got to the Tasks and coroutines section, but I'm frankly confused as to the difference between the various things described in that section: coroutines, tasks, and futures. I think can

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Marko Rauhamaa
Paul Moore p.f.mo...@gmail.com: But I don't understand what a Future is. A future stands for a function that is scheduled to execute in the background. Personally, I have never found futures a very useful idiom in any language (Scheme, Java, Python). Or more to the point, concurrency and the

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Paul Moore
On Tuesday, 5 May 2015 17:11:39 UTC+1, Zachary Ware wrote: On Tue, May 5, 2015 at 10:22 AM, Paul Moore wrote: I'm working my way through the asyncio documentation. I have got to the Tasks and coroutines section, but I'm frankly confused as to the difference between the various things

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-05 Thread Skip Montanaro
Paul ... I'm frankly confused ... You and me both. I'm pretty sure I understand what a Future is, and until the long discussion about PEP 492 (?) started up, I thought I understood what a coroutine was from my days in school many years ago. Now I'm not so sure. Calling Dave Beazley... Calling