Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:bug': 0.04; 'passes': 0.05; 'received:verizon.net': 0.07; 'terry': 0.07; 'caller': 0.09; 'indicates': 0.09; 'raised,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'exception': 0.12; 'am,': 0.13; 'wrote:': 0.15; 'around,': 0.16; 'billy': 0.16; 'looping': 0.16; 'rachel': 0.16; 'reedy': 0.16; '>>>': 0.16; 'onto': 0.19; 'jan': 0.19; "doesn't": 0.22; 'header:In-Reply- To:1': 0.22; 'sort': 0.28; 'problem': 0.29; 'does': 0.32; 'rather': 0.33; 'to:addr:python-list': 0.34; 'header:X-Complaints- To:1': 0.34; 'header:User-Agent:1': 0.34; 'there': 0.34; '(as': 0.34; 'none': 0.35; 'useful': 0.37; 'some': 0.37; 'but': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'header:Mime-Version:1': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; 'header': 0.40; '10:28': 0.84; '14:52': 0.84; 'recognize.': 0.84; 'schrieb': 0.84; 'subject:Possible': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Possible File iteration bug Date: Fri, 15 Jul 2011 17:47:28 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310766608 news.xs4all.nl 23964 [2001:888:2000:d::a6]:52594 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9575 On 7/15/2011 10:42 AM, Billy Mays wrote: > On 07/15/2011 10:28 AM, Thomas Rachel wrote: >> Am 15.07.2011 14:52 schrieb Billy Mays: >>> Really what would be useful is some sort of PauseIteration Exception >>> which doesn't close the generator when raised, but indicates to the >>> looping header that there is no more data for now. >> >> a None or other sentinel value would do this as well (as ChrisA already >> said). > A sentinel does provide a work around, but it also passes the problem > onto the caller rather than the callee: No more so than a new exception that the caller has to recognize. -- Terry Jan Reedy