newbie question: nop statement for try/except

Michael Hudson mwh at python.net
Tue Mar 16 13:50:56 CET 2004


leo <leo at bella.local> writes:

> hi there
> 
> the "try/[except|finally]" construct seems to need the second part "except"
> resp. "finally" due to syntactical reasons.
> 
> but in some cases i guess i do not need any statement in the second
> part. but just carrying on without an idented block doesn't work.
> 
> so, is there something a no-operation statement?

'pass'

Cheers,
mwh

-- 
 As it seems to me, in Perl you have to be an expert to correctly make
 a nested data structure like, say, a list of hashes of instances.  In
 Python, you have to be an idiot not  to be able to do it, because you
 just write it down.             -- Peter Norvig, comp.lang.functional



More information about the Python-list mailing list