On Wednesday, May 25, 2016 at 11:50:43 AM UTC+2, DNF wrote:
>
>
> This works, however, even though Vector is not a subtype of Vector{Any}:
> >> goodbye(v::Vector) = println("bye, bye")
> goodbye (generic function with 1 method)
> >> goodbye([2,'a'])
> bye, bye
> >>> goodbye([2,2])
> bye, bye
>
This is a bit backwards. Vector{Any} is a subtype of Vector, of course!
Perhaps I was expecting too much. I was envisioning a list containing 'any'
sort of elements, and that would include vectors with all types of
elements. After checking I see that numpy arrays are not a subclass of
list, so Vector{Any} is sort of analogous to python 'list'. It just
requires some extra thinking to realize that Vector{'anything'} is not
included in that group.