Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!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.065 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.01; 'programmer': 0.03; 'cc:addr:python-list': 0.11; 'python': 0.11; '9:15': 0.16; 'benjamin': 0.16; 'expressions.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterator': 0.16; 'iterators': 0.16; 'iterators,': 0.16; 'subject:generator': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'features,': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'could': 0.34; 'common': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'application': 0.37; "you're": 0.61; 'skip:n 10': 0.64; 'more': 0.64; 'different': 0.65; 'mar': 0.68; 'results': 0.69; 'lowest': 0.74; 'special': 0.74; '2015': 0.84; 'conscious': 0.84; 'mistaken': 0.84; 'oscar': 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=+F2SVSSauKfNZv4AJokNtQYRdQDQU8ZEVFYdx+pd0Mk=; b=jg14JoaWOeRdhnSFJbEBpp8WkpndFam5IxXfQOH8d0EY0js9KGKvEKozPcL5DqmY1u n94WScfi6+TM7pAqFoPcpuanhqstsLNYg/JzdznaS/HA9XrFYJLRNLCuyLoAtpSa8fm1 VkebRvUWh85YzvlPfCseS4zYWR+oo1sKZNQsRXuZatD/ZIdce0ekOZUIlyE1Ro8APZg1 2sxTQ/qS4cTl60EAq9jxeR3KbWokiUlMLOkNe7NRWLzHm2Qzy5n8BzKnJi/a0MZTTKVK C3P67zCJt2oHLJ9d07eIuBN0glUd/kldochKpBfvTNfoq/OTfg1fwtXXDFganlYk20VR k0Rg== MIME-Version: 1.0 X-Received: by 10.50.111.136 with SMTP id ii8mr94943826igb.34.1426371855528; Sat, 14 Mar 2015 15:24:15 -0700 (PDT) In-Reply-To: <874mpnp6nv.fsf@elektro.pacujo.net> References: <5501be8b$0$13006$c3e8da3$5496439d@news.astraweb.com> <874mpnp6nv.fsf@elektro.pacujo.net> Date: Sun, 15 Mar 2015 09:24:15 +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: 1426371862 news.xs4all.nl 2930 [2001:888:2000:d::a6]:44750 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87453 On Sun, Mar 15, 2015 at 9:15 AM, Marko Rauhamaa wrote: > Oscar Benjamin : > >> A generator is a special type of iterator that results from generator >> functions and generator expressions. > > 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. ChrisA