Is except: ... pass bad style?

Andrew Dalke adalke at mindspring.com
Thu Sep 9 19:47:08 EDT 2004


Michael Hudson wrote:
> Come to think of it
> 
> getattr(myobj, "method", lambda :None)()
> 
> also acheives the same thing.  Bit inscrutable, though.

Who needs a lambda?

   getattr(myobj, "method", Exception)()

Even works for multiple arguments.  Now if only
Exception took kwargs...

Still inscrutable, or at least distracting.

(In other words, don't use this.)

			Andrew
			dalke at dalkescientific.com



More information about the Python-list mailing list