Weird exception in my, um, exception class constructor

Joel Koltner zapwireDASHgroups at yahoo.com
Tue May 27 16:46:28 EDT 2008


Hi Arnaud,

"Arnaud Delobelle" <arnodel at googlemail.com> wrote in message 
news:m2wslf4haq.fsf at googlemail.com...
> 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 bit more.

> OTOH you could just take advantage of Exception.args:
>>>> class MyError(Exception): pass

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...)

---Joel





More information about the Python-list mailing list