Should exceptions have an __init__ method?

Oleg Broytmann phd at phd.pp.ru
Fri Apr 19 10:44:32 EDT 2002


On Fri, Apr 19, 2002 at 03:37:14PM +0100, Graham Ashton wrote:
> I'm unable to determine the difference between these two exception
> classes though (where class E is essentially empty):
> 
> Python 2.2 (#2, Mar 11 2002, 13:24:00) 
> [GCC 2.95.3 20010315 (release)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> class E(Exception):

   Class Exception already has __init__, so you are used it. You don't have
to write your own __init__.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list