Is except: ... pass bad style?

Brandon Craig Rhodes brandon at ten22.rhodesmill.org
Thu Sep 9 15:01:11 EDT 2004


I carelessly wrote:

>     meth = getattr(myobj, method)
>     if meth:
>         meth()

but in fact intended the first line to be

    meth = getattr(myobj, method, None)

Sorry for any confusion. :-)

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon



More information about the Python-list mailing list