Re: [Python-Dev] Tidier Exceptions

2005-05-16 Thread Aahz
On Mon, May 16, 2005, Greg Ewing wrote: > Aahz wrote: >> On Fri, May 13, 2005, Greg Ewing wrote: >>> >>>Instead of an 'args' attribute, I'd suggest that the constructor take >>>keyword arguments and store them in corresponding attributes. >> >> Sounds reasonable, but it should be equally easy to h

Re: [Python-Dev] Tidier Exceptions

2005-05-16 Thread Greg Ewing
Aahz wrote: > On Fri, May 13, 2005, Greg Ewing wrote: > >>Instead of an 'args' attribute, I'd suggest that the constructor take >>keyword arguments and store them in corresponding attributes. > > Sounds reasonable, but it should be equally easy to handle:: > > raise MyError, "message" Certai

Re: [Python-Dev] Tidier Exceptions

2005-05-14 Thread James Y Knight
On May 14, 2005, at 2:34 PM, Aahz wrote: > On Fri, May 13, 2005, Greg Ewing wrote: > > Sounds reasonable, but it should be equally easy to handle:: > > raise MyError, "message" Make that: raise MyError("message") There's really no reason for a multi-argument raise when exceptions are ob

Re: [Python-Dev] Tidier Exceptions

2005-05-14 Thread Aahz
On Fri, May 13, 2005, Greg Ewing wrote: > Brett C. wrote: >> >> Seems like, especially if we require inheritance from a base >> exception class in Python 3000, exceptions should have standard 'arg' >> and 'traceback' attributes with a possible 'context' attribute (or >> always a 'context' attribut

Re: [Python-Dev] Tidier Exceptions

2005-05-13 Thread Brett C.
Guido van Rossum wrote: > [Ka-Ping Yee] > >>Maybe bare 'except' should be spelled 'except *'. > > > -1. > > >>I don't think it can be removed altogether because sometimes you just >>need to be able to do magic, but it can be made a little more explicit. > > > Assuming a single root of the ex

Re: [Python-Dev] Tidier Exceptions

2005-05-13 Thread Brett C.
Guido van Rossum wrote: > [Brett C.] > >>Seems like, especially if we require inheritance from a base exception class >>in >>Python 3000, exceptions should have standard 'arg' and 'traceback' attributes >>with a possible 'context' attribute (or always a 'context' attribute set to >>None if not a

Re: [Python-Dev] Tidier Exceptions

2005-05-13 Thread Tim Peters
[Guido, on string exceptions] > ... > Last I looked Zope 2 still depended on them (especially in the > bowels of ZODB); maybe Tim Peters knows if that's still the > case. Certainly none of that in ZODB, or in ZRS. Definitely some in Zope 2.6:

Re: [Python-Dev] Tidier Exceptions

2005-05-13 Thread Guido van Rossum
[Greg Ewing] > Are there plans as to when string exceptions will be > exterminated? Surely the only places they're used now > are in some very old library modules. No concrete plans; I was always planning to abandon them in 3.0 but haven't felt the need to do it sooner. Last I looked Zope 2 still

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Greg Ewing
Brett C. wrote: > Seems like, especially if we require inheritance from a base exception class > in > Python 3000, exceptions should have standard 'arg' and 'traceback' attributes > with a possible 'context' attribute (or always a 'context' attribute set to > None if not a chained exception). In

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Greg Ewing
Guido van Rossum wrote: > It won't fly as long as we have string exceptions (since there's > nowhere to put the traceback) but once those are dead I like it a lot. Are there plans as to when string exceptions will be exterminated? Surely the only places they're used now are in some very old librar

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Ka-Ping Yee
On Thu, 12 May 2005, Guido van Rossum wrote: > How is "except:" less greppable? Duh. I'm slow today. -- ?!ng ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mail

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Guido van Rossum
[Ka-Ping Yee] > Maybe bare 'except' should be spelled 'except *'. -1. > I don't think it can be removed altogether because sometimes you just > need to be able to do magic, but it can be made a little more explicit. Assuming a single root of the exception tree, you can spell it explicitly as "ex

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Ka-Ping Yee
On Thu, 12 May 2005, Brett C. wrote: > whether bare 'except' statements should go or only catch certain exceptions. Maybe bare 'except' should be spelled 'except *'. I don't think it can be removed altogether because sometimes you just need to be able to do magic, but it can be made a little more

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Guido van Rossum
[Brett C.] > Seems like, especially if we require inheritance from a base exception class > in > Python 3000, exceptions should have standard 'arg' and 'traceback' attributes > with a possible 'context' attribute (or always a 'context' attribute set to > None if not a chained exception). > > I do

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Brett C.
Guido van Rossum wrote: > [Ka-Ping Yee] > >>It occurred to me as i was messing around with handling and re-raising >>exceptions that tossing around these (type, value, traceback) triples >>is irritating and error-prone. >> >>How about just passing around a single value? All we'd have to do is >>p

Re: [Python-Dev] Tidier Exceptions

2005-05-12 Thread Guido van Rossum
[Ka-Ping Yee] > It occurred to me as i was messing around with handling and re-raising > exceptions that tossing around these (type, value, traceback) triples > is irritating and error-prone. > > How about just passing around a single value? All we'd have to do is > put the traceback in value.tra

[Python-Dev] Tidier Exceptions

2005-05-12 Thread Ka-Ping Yee
It occurred to me as i was messing around with handling and re-raising exceptions that tossing around these (type, value, traceback) triples is irritating and error-prone. How about just passing around a single value? All we'd have to do is put the traceback in value.traceback. Implementation: