def scalar_view(scalar, viewty):
    """ Typing for the np scalar 'view' method. """
    if (isinstance(scalar, (types.Float, types.Integer))
            and isinstance(viewty, types.abstract.DTypeSpec)):
        if scalar.bitwidth != viewty.dtype.bitwidth:
            raise errors.TypingError(
                "Changing the dtype of a 0d array is only supported if the "
                "itemsize is unchanged")

        def impl(scalar, viewty):
            return viewer(scalar, viewty)
        return impl
 Typing for the np scalar 'view' method. 
numba/np/math/numbers.py