'Set the unit.
This is used anywhere the unit is set or modified, i.e., in the
initilizer, in ``__imul__`` and ``__itruediv__`` for in-place
multiplication and division by another unit, as well as in
``__array_finalize__`` for wrapping up views.  For Quantity, it just
sets the unit, but subclasses can override it to check that, e.g.,
a unit is consistent.'

def _set_unit(self, unit):

    if (not isinstance(unit, UnitBase)):
        unit = Unit(str(unit), parse_strict=u'silent')
        if (not isinstance(unit, UnitBase)):
            raise UnitTypeError(u'{0}    instances    require    {1}    units,    not    {2}    instances.'.format(type(self).__name__, UnitBase, type(unit)))
    self._unit = unit
