On 17Jun2011 06:00, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> 
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 <c...@zip.com.au> 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
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to