Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #90118

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

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '(even': 0.05; 'interpreter': 0.05; '(of': 0.07; 'result,': 0.07; 'differently.': 0.09; 'exception.': 0.09; 'function,': 0.09; 'raises': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; "wouldn't": 0.14; 'camp': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'generators.': 0.16; 'magic': 0.16; 'procedure?': 0.16; 'semantics': 0.16; 'subject:between': 0.16; 'subject:tasks': 0.16; 'wrote:': 0.18; "python's": 0.19; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'certain': 0.27; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'program,': 0.31; '(maybe': 0.31; 'checking': 0.33; 'fri,': 0.33; 'subject:the': 0.34; "i'd": 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'functions.': 0.36; 'subject:?': 0.36; 'too': 0.37; 'pm,': 0.38; 'rather': 0.38; 'anything': 0.39; 'sure': 0.39; 'either': 0.39; 'expression': 0.60; 'break': 0.61; 'simply': 0.61; 'back': 0.62; 'save': 0.62; 'surrounding': 0.68; 'hour': 0.70; 'gain': 0.79; '2015': 0.84; "it'd": 0.84; 'returns.': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=NWCZsw2ul1DUvR/U2xHK1cCvFM7L4ysiVZhR19ynGQM=; b=C7uauZz/ZSV/59QM1VWb1zpRw5Wd2xDvBEaKXXRu0lSS0AbHD4BCiCpFLUHQqtVyWf GgQa6A/Q5QDfAsuArgmvPN9MVaTMI9H/DM7Tpum4bkhd3oE/jOHEAtzhcC96kKDYFJ8n lhQy1ixjDhyL1Bxeg9sW1KdmLiAAFhSDC/V1y3TwYdqrf1Db7xeads19GjBD8eVzu9HF VYvjnR9vnF4uDODjxt385/x7N9AvS7iKMXVeGfY+D5n3El/kXU6v+vnwo9layFPppEIq UF5KuQs6TypRDCB7IjWZDIWxGl8B2x+0CyemmFUxBlHICM9RhmJguEgey5fVQE+088OR imMg==
MIME-Version 1.0
X-Received by 10.107.134.206 with SMTP id q75mr2591633ioi.27.1431061761110; Thu, 07 May 2015 22:09:21 -0700 (PDT)
In-Reply-To <aca29698-6b7f-4ac7-ba1f-0e60fd28d639@googlegroups.com>
References <344fd8f6-75c1-4b7d-888d-c5c9d4498ec3@googlegroups.com> <878ud27waw.fsf@elektro.pacujo.net> <4ea2d5ac-8c19-4a53-9a09-fe6dbe4a52bd@googlegroups.com> <5549ab43$0$11108$c3e8da3@news.astraweb.com> <b0022fbc-74e2-4990-9773-9e5e07d51f14@googlegroups.com> <mailman.216.1431059590.12865.python-list@python.org> <aca29698-6b7f-4ac7-ba1f-0e60fd28d639@googlegroups.com>
Date Fri, 8 May 2015 15:09:21 +1000
Subject Re: asyncio: What is the difference between tasks, futures, and coroutines?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.217.1431061769.12865.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1431061769 news.xs4all.nl 2950 [2001:888:2000:d::a6]:40792
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:90118

Show key headers only | View raw


On Fri, May 8, 2015 at 2:53 PM, Rustom Mody <rustompmody@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. You could write an interactive interpreter
>> that has some magic that recognizes that certain functions always
>> return None (maybe by checking their annotations), and omits printing
>> their return values, while still printing the return values of other
>> functions.
>
>
> Hoo Boy!  You seem to be in the 'the-more-the-better' (of magic) camp

No way! I wouldn't want the interactive interpreter to go too magical.
I'm just saying that it wouldn't break Python to have it do things
differently.

>> I'm not sure what it'd gain you, but it wouldn't change the
>> concepts or semantics surrounding None returns.
>
> It would sure help teachers who get paid by the hour and would rather spend
> time on technical irrelevantia than grapple with significant concepts

Why have the concept of a procedure? Python's rule is simple: Every
function either returns a value or raises an exception. (Even
generators. When you call a generator function, you get back a return
value which is the generator state object.) The procedure/function
distinction is irrelevant.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

asyncio: What is the difference between tasks, futures, and coroutines? Paul  Moore <p.f.moore@gmail.com> - 2015-05-05 08:22 -0700
  Re: asyncio: What is the difference between tasks, futures, and coroutines? Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-05-05 11:11 -0500
    Re: asyncio: What is the difference between tasks, futures, and coroutines? Paul  Moore <p.f.moore@gmail.com> - 2015-05-05 10:55 -0700
  Re: asyncio: What is the difference between tasks, futures, and coroutines? Terry Reedy <tjreedy@udel.edu> - 2015-05-05 13:15 -0400
  Re: asyncio: What is the difference between tasks, futures, and coroutines? Marko Rauhamaa <marko@pacujo.net> - 2015-05-05 20:45 +0300
    Re: asyncio: What is the difference between tasks, futures, and coroutines? Rustom Mody <rustompmody@gmail.com> - 2015-05-05 21:47 -0700
      Re: asyncio: What is the difference between tasks, futures, and coroutines? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-06 15:48 +1000
        Re: asyncio: What is the difference between tasks, futures, and coroutines? Rustom Mody <rustompmody@gmail.com> - 2015-05-07 21:06 -0700
          Re: asyncio: What is the difference between tasks, futures, and coroutines? Chris Angelico <rosuav@gmail.com> - 2015-05-08 14:33 +1000
            Re: asyncio: What is the difference between tasks, futures, and coroutines? Rustom Mody <rustompmody@gmail.com> - 2015-05-07 21:53 -0700
              Re: asyncio: What is the difference between tasks, futures, and coroutines? Rustom Mody <rustompmody@gmail.com> - 2015-05-07 21:55 -0700
              Re: asyncio: What is the difference between tasks, futures, and coroutines? Chris Angelico <rosuav@gmail.com> - 2015-05-08 15:09 +1000
                Re: asyncio: What is the difference between tasks, futures, and coroutines? Rustom Mody <rustompmody@gmail.com> - 2015-05-07 23:36 -0700
                Re: asyncio: What is the difference between tasks, futures, and coroutines? Chris Angelico <rosuav@gmail.com> - 2015-05-08 16:42 +1000
                Re: asyncio: What is the difference between tasks, futures, and coroutines? Dave Angel <davea@davea.name> - 2015-05-08 07:53 -0400
                Re: asyncio: What is the difference between tasks, futures, and coroutines? Chris Angelico <rosuav@gmail.com> - 2015-05-08 23:02 +1000
      Re: asyncio: What is the difference between tasks, futures, and coroutines? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-05-06 09:11 -0400
        Re: asyncio: What is the difference between tasks, futures, and coroutines? Rustom Mody <rustompmody@gmail.com> - 2015-05-07 21:20 -0700
  Re: asyncio: What is the difference between tasks, futures, and coroutines? Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-05 11:46 -0600
    Re: asyncio: What is the difference between tasks, futures, and coroutines? Paul  Moore <p.f.moore@gmail.com> - 2015-05-05 11:03 -0700
  Re: asyncio: What is the difference between tasks, futures, and coroutines? Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-05 12:55 -0500
  Re: asyncio: What is the difference between tasks, futures, and coroutines? Terry Reedy <tjreedy@udel.edu> - 2015-05-05 18:38 -0400

csiph-web