Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '16,': 0.03; 'api.': 0.05; 'referring': 0.07; 'cc:addr:python-list': 0.11; "wouldn't": 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'generator.': 0.16; 'iterators': 0.16; 'send()': 0.16; 'subject:generator': 0.16; 'throw': 0.16; 'why,': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'adds': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'subject:/': 0.26; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'wondering': 0.29; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'overhead': 0.31; 'could': 0.34; 'offered': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'then,': 0.60; 'offer': 0.62; 'mar': 0.68; 'other.': 0.75; '2015': 0.84; 'replacements': 0.84; 'why?': 0.91; '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=vI/KGv/NIGGfMi38ugvB3h9IsmqFE0d8/g5s39HI0sk=; b=pgcjoTUP9TEI9NXfZMJCAxLdrFPHeY3HTov7Xql/tg8oXbbYydXO0YpfjyyxPCrjE8 qNkp7khEsCSbcYYn1NTzIDT/VSxuiaiRTiXILaZw62yTeu/z/HamIxOHIzdndLFtkda6 BcZ/VCEHSG54bVqp8NiUebQ0uHHqi/Uwg+5SVbt6ivvKynLRDfxL8b+8LiVVs5bpzYtP xg+UEF+mfcDDIkxgsX/zET7BDSpxw6SnUxeL2nSkOcL87bJ2P2m8YzjI5MOMUPMj3Xe4 h5evwP3F5rnNAjtwsdVzvSbGYWswWI2ynMaQ55MYnV3pst4GR8jteBr1xrpZT1JNiSju 9Qjg== MIME-Version: 1.0 X-Received: by 10.107.160.212 with SMTP id j203mr107457564ioe.43.1426490505736; Mon, 16 Mar 2015 00:21:45 -0700 (PDT) In-Reply-To: <87egopmn4z.fsf@elektro.pacujo.net> References: <5501be8b$0$13006$c3e8da3$5496439d@news.astraweb.com> <874mpnp6nv.fsf@elektro.pacujo.net> <87y4mznmj8.fsf@elektro.pacujo.net> <55062bda$0$12998$c3e8da3$5496439d@news.astraweb.com> <87egopmn4z.fsf@elektro.pacujo.net> Date: Mon, 16 Mar 2015 18:21:45 +1100 Subject: Re: generator/coroutine terminology From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426490508 news.xs4all.nl 2849 [2001:888:2000:d::a6]:53697 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87516 On Mon, Mar 16, 2015 at 6:12 PM, Marko Rauhamaa wrote: > > I was actually referring to the offered API. It still seems to me like > all iterators could offer close(), send() and throw(). Why? To make all > iterators drop-in replacements of each other. > > Then, you could also stop wondering what to call the thingy returned by > a generator. Why, it would be an iterator. You wouldn't then have any > other use for a generator than the function that returns an iterator. That just adds unnecessary overhead to every iterator. Also, what happens when you throw something into iter([1,2,3]) ? Or send it a value? What happens? ChrisA