astropy/astropy — pull request #1851 by mhvk (2013-11-30 21:25:40+00:00)
Title: Let Angle subclasses decide on class of calculation results; correct Latitude __setitem__

I noticed `Angle.__array_wrap__` initialises of a new `Angle` object when a view would do. But correcting it, I realised this really is in the wrong place: we want `Longitude` and `Latitude` to fall back to `Angle` when any calculation is done, but this may be unwanted behaviour for possible future `Angle` subclasses. Hence, this PR moves the `__array_wrap__` to those subclasses.

I also noticed that in `Latitude` items get set *before* they are being checked, which means that `lat[:]=100*u.deg` will raise an error message after messing up the contents. Validation is now done first.

(For my own sanity, this is based on #1848, so that one should be merged first.)