Handling PyArray in Generic Functions: how to use `similar` and `copy` correctly

similar and copy do not (always) create arrays of the same type, i.e., the following also fails

a = view([1,2,3,4], 1:2)
b = similar(a)
foo(a, b)

A possible fix is to change the type signature of foo to foo(a::AbstractVector, b::AbstractVector). Unless there is a specific reason, it is often not necessary to restrict both arguments to the very same array type V, instead of just being both abstract arrays.