astropy/astropy — pull request #1773 by mhvk (2013-11-12 04:18:46+00:00)
Title: Quantity from unit or string

This (re-)introduces the ability to initialise a `Quantity` from a unit or a string (see #1767; apologies to @wkerzendorf and @embray...). With it,
```
In [1]: import astropy.units as u

In [2]: u.Quantity(u.m)
Out[2]:

In [3]: u.Quantity('15 km/s')
Out[3]:
```
Care has been taken to test for string/unit in a place where very little can get delayed (only `Quantity(values)`).

Indeed, in the process of reorganising to allow a test in a harmless place, quite a few speed-ups were made, including the removal of `_validate_values`. As a by-product of the speed-ups, this closes #1716:
```
In [9]: np.rollaxis(u.Quantity([[1.,2.],[3.,4.]], u.m), 1, 0)
Out[9]:

```

Missing still is an update to the docstring; @adrn, as you brought this up, suggestions for a way to keep this simple & clean? Maybe only mention it in `Notes`? (Aside: the fact that one can initialise a `Unit` with a `Quantity` is not documented...)