Joel Koltner [EMAIL PROTECTED] writes:
Paul Hankin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Did you actually write self,args = args?
(looks at source code)
[EMAIL PROTECTED] Why, yes, yes I did! Thanks for catching that...
This is odd, because you should get this error
I have a generic (do nothing) exception class that's coded like this:
class MyError(exceptions.Exception):
def __init__(self,args=None):
self.args = args
When I attempt to raise this exception via 'raise MyError' I get an exception
within the MyError constructor __init__ as follows:
Joel Koltner [EMAIL PROTECTED] writes:
I have a generic (do nothing) exception class that's coded like this:
class MyError(exceptions.Exception):
def __init__(self,args=None):
self.args = args
When I attempt to raise this exception via 'raise MyError' I get an
exception within
On May 27, 9:21 pm, Joel Koltner [EMAIL PROTECTED]
wrote:
I have a generic (do nothing) exception class that's coded like this:
class MyError(exceptions.Exception):
def __init__(self,args=None):
self.args = args
When I attempt to raise this exception via 'raise MyError' I get an
Hi Arnaud,
Arnaud Delobelle [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
That's because the class 'Exception' defines a descriptor 'args' which
has to be a sequence.
Ah, thanks. I was following the example in Beazley's book and should have dug
into the actual documentation a
Paul Hankin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Did you actually write self,args = args?
(looks at source code)
[EMAIL PROTECTED] Why, yes, yes I did! Thanks for catching that...
--
http://mail.python.org/mailman/listinfo/python-list
Joel Koltner [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Sounds good to me. I take it that, if I don't inherit from Exception,
various
| expected behaviors will break? (This is what Beazley suggests...)
All builtin exceptions have been in the builtin namespace for a while.