astropy/astropy — pull request #924 by iguananaut (2013-04-01 15:37:52+00:00)
Title: Use the `ignored()` context manager where appropriate.

This little bugger was just added to the stdlib, and I wanted to bring it into
astropy and use it where appropriate before I forgot it exists, because
I was so enamored with it: http://bugs.python.org/issue15806

As this notebook [1] shows, this is a little slower (about 5x, but on the
order of < 10us) than using try/except directly, so I avoided using it
in some loops. But elsewhere it's fine to use and a lot nicer looking.
But this is mostly silly and purely optional.

[1] http://nbviewer.ipython.org/urls/gist.github.com/iguananaut/169ba550944e4020dff9/raw/0247ab9190b39b35b14c750aa8fe93d3da1228aa/ignored_performance.ipynb