Bare Excepts

Lie Ryan lie.1296 at gmail.com
Sat Jan 2 09:10:51 EST 2010


On 1/2/2010 9:42 PM, Steven D'Aprano wrote:
> On Fri, 01 Jan 2010 15:27:57 -0800, myle wrote:
>
>> Why we should prefer ``if: ...'' over  a ``try: ... except something:
>> pass'' block?
>
> We shouldn't, not in general.

One exception (pun intended) is if the try-block have a side effect that 
is difficult to cleanup cleanly.



More information about the Python-list mailing list