I Need A Placeholder

Carsten Haese carsten.haese at gmail.com
Thu Jun 26 13:57:06 EDT 2008


John Salerno wrote:
> "Joshua Kugler" <jkugler at bigfoot.com> wrote in message 
> news:mailman.884.1214500462.1044.python-list at python.org...
>> except:
>>    pass
>>
>> is the usual technique there.
> 
> Is there any other? 

Sure. Evaluating any side-effect free expression and ignoring the result 
will work:

try:
     # do somthing
except:
     None

try:
     # do something
except:
     "I don't care about the exception."

Of course, using pass *is* the preferred method.

--
Carsten Haese
http://informixdb.sourceforge.net



More information about the Python-list mailing list