Is except: ... pass bad style?

marduk marduk at
Thu Sep 9 18:26:18 CEST 2004

I commonly use code like this

    # call optional method
except AttributeError:
    # no biggie

Occasionally I use pylint, which is a good tool, but in the above
snippet pylint will complain that 'Except doesn't do anything'.  True,
but is that bad style?  I know there are other ways of doing it, but
of all the other "obvious" ones, this appears the most straight

Should I ignore pylint or is there a more Pythonic way to do this?

More information about the Python-list mailing list