Update the __int__ method to match the behavior of Numpy.
Similar to Numpy, only 0-D arrays or length-1 arrays can be converted to scalars.
Example:
> var A = NDArray[dtype](6, random=True)
> print(int(A))
Unhandled exception caught during execution: Only 0-D arrays or length-1 arrays can be converted to scalars
mojo: error: execution exited with a non-zero result: 1
> var B = NDArray[dtype](1, 1, random=True)
> print(int(B))
14
Update the
__int__
method to match the behavior of Numpy.Similar to Numpy, only 0-D arrays or length-1 arrays can be converted to scalars.
Example: