Another Sets Problem

Jean-Michel Pichavant jeanmichel at sequans.com
Tue Dec 29 05:29:47 EST 2009


Matt Nordhoff wrote:
> Victor Subervi wrote:
>   
>> On Mon, Dec 28, 2009 at 1:41 PM, MRAB <python at mrabarnett.plus.com
>> <mailto:python at mrabarnett.plus.com>> wrote:
>>     
>>> DON'T USE BARE EXCEPTS!
>>>
>>> (There are 2 in your code.)
>>>       
>> There are times when they are *necessary*.
>>     
>
> No, there aren't.
>
> Even if there were, this is not one of those situations.
>   
And to elaborate a little bit, someone said in this list (sorry, don't 
remember who) that often people think that making their code robust is 
one of the top priority, especially when you are providing some services 
to clients. That could be true. The fact is that most newcomers thinks 
bare try except will do the trick: "look, my server never crashes". Yes 
it does not crash, but even worse, it handles exception in an 
inapropriate way that leads the server to behave in a reliable, yet 
unpredictable, manner. And that is definitely *not* being robust.


JM




More information about the Python-list mailing list