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

2009-01-20 Thread Aahz
In article , Terry Reedy 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

Re: message of Exception

2009-01-06 Thread Steven Woody
On Wed, Jan 7, 2009 at 12:02 PM, Terry Reedy wrote: > Steven Woody wrote: >> >> Hi, >> >> I am trying define an Exception as below: >> >> class MyError(Exception): >>def __init__(self, message): >>self.message = message >> >> And, I expect that when I raise a MyError as >>raise MyE

Re: message of Exception

2009-01-06 Thread Terry Reedy
Steven Woody wrote: Hi, I am trying define an Exception as below: class MyError(Exception): def __init__(self, message): self.message = message 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 MyEr

Re: message of Exception

2009-01-06 Thread Steven Woody
On Wed, Jan 7, 2009 at 11:09 AM, Chris Rebert wrote: > On Tue, Jan 6, 2009 at 6:56 PM, Steven Woody wrote: >> Hi, >> >> I am trying define an Exception as below: >> >> class MyError(Exception): >>def __init__(self, message): >>self.message = message >> >> And, I expect that when I rai

Re: message of Exception

2009-01-06 Thread Chris Rebert
On Tue, Jan 6, 2009 at 6:56 PM, Steven Woody wrote: > Hi, > > I am trying define an Exception as below: > > class MyError(Exception): >def __init__(self, message): >self.message = message > > And, I expect that when I raise a MyError as >raise MyError, "my message" > the python sho

message of Exception

2009-01-06 Thread Steven Woody
Hi, I am trying define an Exception as below: class MyError(Exception): def __init__(self, message): self.message = message And, I expect that when I raise a MyError as raise MyError, "my message" the python should print a line such as MyError: my message But I did not get th