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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.068 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; 'programmer': 0.03; 'cc:addr:python-list': 0.11; 'python': 0.11; '9:15': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterators': 0.16; 'iterators,': 0.16; 'subject:generator': 0.16; 'throw': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'features,': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'subject:/': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'exceptions': 0.31; 'could': 0.34; 'common': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'application': 0.37; 'generic': 0.38; "you're": 0.61; 'skip:n 10': 0.64; 'provide': 0.64; 'more': 0.64; 'different': 0.65; 'close': 0.67; 'mar': 0.68; 'lowest': 0.74; 'special': 0.74; '2015': 0.84; 'conscious': 0.84; 'mistaken': 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=1j70hdFv0TPhK8xJsaeiWSVtNXiPzS7XjZRHxIFbGWA=; b=GiYTaAtv0pTmK5snBPK0TO/wcGB0NKofJ6TthYIyQq1b/Ip5N8sALRT98mCcrEn2A8 lN4BpK2aBVt1nWt/KaqCRnd2tEQS6Zje3RZdlX3bsux8aOLrxij7QvulpN3QfVpevcU0 +gYXLW9FUCmgsGWc2MusOR+LBahKEr9kvPgw7ueqN7tX93uE60RUgL8c+NBqegKANK2U vOPxAylcYqwIIVzYJiWPcL0RfWFalc7kSePWl8z15JrbUC/LUTh3y6kTbSM5BaFzG7rL fBnoaSIScRG3Aadxba0YZuqM6uet0a+7EcWGyeQC5hfGwtUlEF6N0iUGf7HjS+4RlYCv 6zOw== MIME-Version: 1.0 X-Received: by 10.50.29.109 with SMTP id j13mr3535825igh.2.1426378977353; Sat, 14 Mar 2015 17:22:57 -0700 (PDT) In-Reply-To: <87y4mznmj8.fsf@elektro.pacujo.net> References: <5501be8b$0$13006$c3e8da3$5496439d@news.astraweb.com> <874mpnp6nv.fsf@elektro.pacujo.net> <87y4mznmj8.fsf@elektro.pacujo.net> Date: Sun, 15 Mar 2015 11:22:57 +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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426378980 news.xs4all.nl 2969 [2001:888:2000:d::a6]:34229 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87458 On Sun, Mar 15, 2015 at 11:15 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Sun, Mar 15, 2015 at 9:15 AM, Marko Rauhamaa wrote: >>> Is it necessary/useful for a Python application programmer to be >>> conscious of the different types of iterator? What mistaken usage >>> could arise if the application just treated all iterators as, well, >>> iterators? >> >> If you treat them all as iterators, then you're safe, because that's >> the lowest common denominator. But there are a number of other >> iterators that have more features, including files, generators, etc. > > What features do generator iterators provide on top of generic > iterators? You can send values into them, throw exceptions into them, and close them (which is a special case of the latter). ChrisA