Steven Bethard wrote:

 > Exceptions are for
> "exceptional" conditions, that is, things that you expect to happen 
> infrequently[1].  So if I think the code is going to fail frequently, I 
> test the condition, but if I think it won't, I use exceptions.

I think there exceptions (no pun intended) to that rule as well. A 
classic example is writing to a file. Even if you expect this to be 
impossible, it's best to just create it and trap the exception, thereby 
avoiding a race condition.
-- 
Michael Hoffman
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to