Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:module': 0.04; 'received:edu.au': 0.07; 'python': 0.08; 'mix': 0.09; 'throw': 0.09; 'wrote:': 0.14; '"exit': 0.16; '"finally"': 0.16; '"in"': 0.16; '"return"': 0.16; 'clash': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'word),': 0.16; 'cc:addr:python-list': 0.17; 'keyword': 0.19; 'cheers,': 0.19; 'header:In-Reply-To:1': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'statement,': 0.23; 'raise': 0.28; 'e.g.': 0.29; 'import': 0.29; 'cc:addr:python.org': 0.30; 'module': 0.30; 'exiting': 0.30; 'steven': 0.32; 'lines': 0.33; 'thinking': 0.34; 'header:User-Agent:1': 0.35; "d'aprano": 0.35; 'charset:us-ascii': 0.36; 'uses': 0.36; 'received:au': 0.37; 'another': 0.37; 'but': 0.38; 'word,': 0.38; 'subject:: ': 0.38; "i'd": 0.39; 'feature': 0.40; 'lives': 0.63; 'our': 0.63; 'world.': 0.65; 'received:202': 0.66; 'here': 0.66; 'cameron': 0.73; 'age': 0.84; 'descriptive': 0.84; 'grey': 0.96 Date: Sat, 18 Jun 2011 12:36:42 +1000 From: Cameron Simpson To: Steven D'Aprano Subject: Re: break in a module MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4dfaed89$0$30002$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.20 (2009-06-14) References: <4dfaed89$0$30002$c3e8da3$5496439d@news.astraweb.com> Cc: python-list@python.org 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: 24 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308364612 news.xs4all.nl 49176 [::ffff:82.94.164.166]:35892 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7877 On 17Jun2011 06:00, Steven D'Aprano wrote: | If we were to have a "exit this module early, but without exiting Python | altogether" statement, I'd consider "exit" to be the most descriptive | name, although it would clash with existing uses of the word, e.g. | sys.exit(). Overloading "break" strikes me as disagreeable, but not as | disagreeable as overloading "return" or "in" :) Just to throw another approach into the mix (because I was thinking about the "finally" word), what about: raise StopImport along the lines of generators' "raise StopIteration". Then the import machinery can catch it, no new keyword is needed and no existing keyword needs feature creeping. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ And it is not our part here to take thought only for a season, or for a few lives of Men, or for a passing age of the world. - Gandalf the grey