def array_product(space, w_arr):
    """ Calculate the product of values in an array """
    if space.arraylen(w_arr) == 0:
        return space.newint(1)
    res = 1
    with space.iter(w_arr) as itr:
        while not itr.done():
            _, w_val = itr.next_item(space)
            w_num = space.as_number(w_val)
            if w_num.tp == space.tp_float:
                res *= space.float_w(w_num)
            if w_num.tp == space.tp_int:
                res *= space.int_w(w_num)
    return space.wrap(res)