[Python-Dev] PEP 344 (original) (raw)
Guido van Rossum guido at python.org
Sat Mar 3 02:09:00 CET 2007
- Previous message: [Python-Dev] PEP 344
- Next message: [Python-Dev] PEP 344 (was: with_traceback)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Personally, +1 for new attributes, -1 for more syntax, +0 for making it bad style to pre-create exceptions. One object should have all you need.
On 3/2/07, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
Guido van Rossum wrote: > [snip..] > The one thing that makes me not want to give up yet is that having the > traceback, context, cause etc. as attributes of the exception object > would seem to make the API for handling exceptions that much cleaner, > compared to having to call sys.excinfo() or even "except E as v with > tb". > > So, despite the existence of libraries that pre-create exceptions, how > bad would it really be if we declared that use unsafe? It wouldn't be > hard to add some kind of boobytrap that goes off when pre-created > exceptions are raised multiple times. If this had always been the > semantics I'm sure nobody would have complained and I doubt that it > would have been a common pitfall either (since if it doesn't work, > there's no bad code abusing it, and so there are no bad examples that > newbies could unwittingly emulate). > > Personally, I think the new attributes and the new syntax are great improvements to exception handling. I would be sad to see parts of these proposals not happen.
Michael Foord
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] PEP 344
- Next message: [Python-Dev] PEP 344 (was: with_traceback)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]