Can "self" crush itself?

Aahz aahz at pythoncraft.com
Thu Nov 26 17:47:45 CET 2009


In article <7ace3de0-4588-4b7d-9848-d97298717597 at z41g2000yqz.googlegroups.com>,
n00m  <n00m at narod.ru> wrote:
>> Or just raise an exception in __init__(),..
>
>Then we are forced to handle this exception outside of class code.

Absolutely!  That's the whole point.  If you can't construct the class,
you *should* raise an error.  The only other workable option is to leave
the target set to None, which is uglier because you don't track the
error.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

The best way to get information on Usenet is not to ask a question, but
to post the wrong information.  



More information about the Python-list mailing list