Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.04; 'raises': 0.07; 'defined.': 0.09; 'dict': 0.09; 'enormous': 0.09; 'errors,': 0.09; 'runtime': 0.09; 'subject:set': 0.09; 'bug': 0.10; 'cc:addr:python-list': 0.10; 'static': 0.13; 'code?': 0.16; 'iterating': 0.16; 'iterator.': 0.16; 'iterators': 0.16; 'set,': 0.16; 'there?': 0.16; 'wrote:': 0.17; 'detect': 0.17; 'cc:2**0': 0.23; 'errors': 0.23; 'cc:no real name:2**0': 0.24; 'paul': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'checking': 0.27; 'writes:': 0.29; "we're": 0.30; 'checks': 0.30; 'file': 0.32; 'structure': 0.32; 'another': 0.33; 'changed': 0.34; 'pm,': 0.35; 'really': 0.36; 'should': 0.36; 'level': 0.37; 'why': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'tracking': 0.61; 'between': 0.63; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'low': 0.83; 'forced': 0.84; 'angel': 0.93 Date: Thu, 16 Aug 2012 19:11:19 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Paul Rubin Subject: Re: set and dict iteration References: <7xy5le7cli.fsf@ruckus.brouhaha.com> In-Reply-To: <7xy5le7cli.fsf@ruckus.brouhaha.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:TeCp50Iv8P5qTKqkXfwyA1FEufrMHUFfk3hMo8sZQn2 YmgcIzoJGKACNBicpd6DsjDRQ7T+iWMYg0gaj2eBPGZ5vOyZol PW30OD4q3YmE0y7JcsWt9zCrCcI8tjmmQvuTZh2sgWYxY42Y3X jN0NkGD3S8WlCBAWpa0EH6gXT4FWuBtpAcACVqT6DmScmRpdyQ dikEZOIAFXJLo2+r4VbuIaKU3q1d2Gi1Z2Y3r0gsKspP+27mKK dT5cEStVCg5hGLPORAIXc+GBkoWVm+1ikgnsP+CyYOmLEt4bDu d6DqMytj9FVOyYBXAz3o7RSrncDD++hxW4lXWCV/WSR+sVRmo9 dHLKHCfAhCTodMHJvc7k= Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: davea@dejaviewphoto.com 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: 1345158704 news.xs4all.nl 6975 [2001:888:2000:d::a6]:54278 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27213 On 08/16/2012 05:26 PM, Paul Rubin wrote: > Dave Angel writes: >> Everything else is implementation defined. Why should an implementation >> be forced to have ANY extra data structure to detect a static bug in the >> caller's code? > For the same reason the interpreter checks for type errors at runtime > and raises TypeError, instead of letting the program go into the weeds. There's an enormous difference between type errors, which affect the low level dispatch, and checking for whether a dict has changed and may have invalidated the iterator. If we were really going to keep track of what iterators are tracking a given dict or set, why stop there? Why not check if another process has changed a file we're iterating through? Or ...