Style of "raise" (was Re: message of Exception)

Aahz aahz at
Wed Jan 21 00:48:45 CET 2009

In article <mailman.6709.1231300952.3487.python-list at>,
Terry Reedy  <tjreedy at> wrote:
>Steven Woody wrote:
>> And, I expect that when I raise a MyError as
>>     raise MyError, "my message"
>In 2.x you may and in 3.0 you must write that as
>raise MyError("my message")
>Best to start looking forward ;-).

Funny, when I suggested to MvL that he do that (when I saw a checkin made
against 2.x code), he rebuffed me.  I didn't get a clear answer for why,
so if you care, you need to ask him.
Aahz (aahz at           <*>

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it."  --Brian W. Kernighan

More information about the Python-list mailing list