A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-August/055188.html below:

[Python-Dev] PEP 348: Exception Reorganization for Python 3.0

[Python-Dev] PEP 348: Exception Reorganization for Python 3.0 [Python-Dev] PEP 348: Exception Reorganization for Python 3.0Raymond Hettinger raymond.hettinger at verizon.net
Sat Aug 6 18:12:35 CEST 2005
[Nick Coghlan]
> As others have pointed out, GeneratorExit and StopIteration should
never
> reach
> the job execution loop - if they do, there's a bug in the job, and
they
> should
> be caught and logged.

Please read my other, detailed post on this (8/5/2005 4:05pm).  It is a
mistake to bypass control flow exceptions like GeneratorExit and
StopIteration.  Those need to remain under Exception.  Focus on your
core use case of eliminating the common idiom:

   try: 
       block()
   except KeyboardInterrupt:
       raise
   except:
       pass    # or some handler/logger

In real code, I've never seen the above idiom used with StopIteration.
Read Guido's note and my note.  There are plenty of valid use cases for
a bare except intending to catch almost everything including programming
errors from NameError to StopIteration.  It is a consenting-adults
construct.  Your proposal breaks a major use case for it (preventing
your sales demos from crashing in front of your customers, writing
fault-tolerant programs, etc.)



Raymond

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4