// If items have different shapes just return arr
if not all_same_shape:
return arr
dtype = reduce(np.result_type, not_none)
result = np.empty(arr.shape + shape, dtype=dtype)
result.fill(fill)
for ijk in ndindex(arr.shape):
if arr[ijk] is not None:
After Change
return arr
// Find common dtype. np.result_type can do this more simply, but it is
// only available for numpy 1.6.0
dtypes = set(a.dtype for a in not_none)
tiny_arrs = [np.zeros((1,), dtype=dt) for dt in dtypes]
dtype = reduce(np.add, tiny_arrs).dtype
// Create output array and fill
result = np.empty(arr.shape + shape, dtype=dtype)