'Resolve the Numba type of Python value *val*.
This is called from numba._dispatcher as a fallback if the native code
cannot decide the type.'

def typeof_pyval(self, val):

    try:
        tp = typeof(val, Purpose.argument)
    except ValueError:
        tp = types.pyobject
    else:
        if (tp is None):
            tp = types.pyobject
    return tp
