Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!2a02:590:1:1::196.MISMATCH!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-Id: <2372171.ArG6xLiZAS@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 23 Jun 2011 01:30:13 +0200 User-Agent: KNode/4.4.7 Content-Transfer-Encoding: 7Bit Subject: Re: writable iterators? Newsgroups: comp.lang.python References: <4e026497$0$29975$c3e8da3$5496439d@news.astraweb.com> Followup-To: comp.lang.python MIME-Version: 1.0 Lines: 33 NNTP-Posting-Date: 23 Jun 2011 01:30:13 CEST NNTP-Posting-Host: 77566dac.newsspool3.arcor-online.net X-Trace: DXC=^3GXSXa?l9JAa;:RKVJ>LEMcF=Q^Z^V3H4Fo<]lROoRA8kF Steven D'Aprano wrote: >> I *guess* that what you mean by "writable iterators" is that rebinding e >> should change seq in place, i.e. you would expect that seq should now >> equal [42, 42]. Is that what you mean? It's not clear. >> >> Fortunately, that's not how it works, and far from being a "limitation", >> it would be *disastrous* if iterables worked that way. I can't imagine >> how many bugs would occur from people reassigning to the loop variable, >> forgetting that it had a side-effect of also reassigning to the iterable. >> Fortunately, Python is not that badly designed. > > And for an iterator like > > def things(): > yield 1 > yield 11 > yield 4 > yield 9 > > I don't know what it could even mean. You could have tried to debug. Please trim your quotes to the relevant minimum. -- PointedEars Bitte keine Kopien per E-Mail. / Please do not Cc: me.