'Return the numba type of a Python value that is being used
as a runtime constant.
ValueError is raised for unsupported types.'

def resolve_value_type(self, val):

    try:
        ty = typeof(val, Purpose.constant)
    except ValueError as e:
        typeof_exc = utils.erase_traceback(e)
    else:
        return ty
    if isinstance(val, (types.ExternalFunction, types.NumbaFunction)):
        return val
    ty = self._get_global_type(val)
    if (ty is not None):
        return ty
    raise typeof_exc
