A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-August/027900.html below:

PEP 293, Codec Error Handling Callbacks)

[Python-Dev] Mutable exceptions? (was Re: PEP 293, Codec Error Handling Callbacks) [Python-Dev] Mutable exceptions? (was Re: PEP 293, Codec Error Handling Callbacks)Guido van Rossum guido@python.org
Thu, 15 Aug 2002 14:15:51 -0400
> This looks like an issue that potentially deserves more community
> feedback, so I'm ripping it out and starting a new thread: should
> exception objects be treated as mutable as exceptions get caught and
> re-raised?

(A new thread in python-dev hardly counts as "community feedback".)

I'd say definitely.  Code like this looks reasonable to me:

  def some_function(arg):
    try:
      call_some_other_function(arg)
    except SomeExpectedExceptionClass, obj:
      obj.add_context(arg)
      raise

Then some outer piece of code catches exceptions and produces a
traceback augmented by information added by various calls to
add_context().

--Guido van Rossum (home page: http://www.python.org/~guido/)



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