astropy/astropy — pull request #240 by eteq (2012-05-16 21:23:32+00:00)
Title: Iterable numpyfix

This is a small fix in `astropy.misc.isiterable` - @iguanaut in particular should look at this, as he wrote it. The key problem is that 0d numpy arrays are technically members of `collections.Iterable`, but they are not iterable because they're 0-dimensional. This just short-circuits the function and returns False in that particular case.

Normally I would be against corner-cases like this, but this is one I run into *all the time*, and it would be nice to be able to just do `isiterable(val)` and trust it when `val` might be a numpy scalar.

(This also adds a few tests for `isiterable`)