Re: [Tutor] Calling super in __init__

2008-05-19 Thread wcyee
Kent and Paul, Thanks very much for your help! On Mon, May 19, 2008 at 8:43 AM, Paul McGuire <[EMAIL PROTECTED]> wrote: > >> > Hi - I wrote a custom exception class as follows: > > class CustomError(Exception): >def __init__(self, msg): >super(CustomError

Re: [Tutor] Calling super in __init__

2008-05-19 Thread Paul McGuire
>> Hi - I wrote a custom exception class as follows: class CustomError(Exception): def __init__(self, msg): super(CustomError, self).__init__(self, msg) But this doesn't work as expected: >> Correct use of super would be: class

Re: [Tutor] Calling super in __init__

2008-05-19 Thread Kent Johnson
On Mon, May 19, 2008 at 3:27 AM, wcyee <[EMAIL PROTECTED]> wrote: > Hi - I wrote a custom exception class as follows: > > class CustomError(Exception): > def __init__(self, msg): > super(CustomError, self).__init__(self, msg) Should be super(CustomError, self).__init__(msg) i.e. don'

[Tutor] Calling super in __init__

2008-05-19 Thread wcyee
Hi - I wrote a custom exception class as follows: class CustomError(Exception): def __init__(self, msg): super(CustomError, self).__init__(self, msg) But this doesn't work as expected: try: raise CustomError('something bad') except CustomError, err: print err.message err.mes