# Why \[1, 2, 3\] is not a Vector{Number}?

**URL:** <https://discourse.julialang.org/t/why-1-2-3-is-not-a-vector-number/52645>\
**Category:** New to Julia\
**Tags:** question, parametric-types\
**Created:** [December 31, 2020, 8:26am UTC](https://discourse.julialang.org/t/why-1-2-3-is-not-a-vector-number/52645 "2020-12-31T08:26:16Z")\
**Posts on this page:** 1\
**Showing post:** 41

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [December 9, 2022, 3:20pm UTC](https://discourse.julialang.org/t/why-1-2-3-is-not-a-vector-number/52645/41 "2022-12-09T15:20:25Z")

</div>

It is all about whether the container (or container of containers) holds abstract types (versatile but slow) or concrete types (restrictive but fast).

```julia
v1 = [1, 2] # 2-element Vector{Int64}
v2 = [1.1, 2.2] # 2-element Vector{Float64}
vv1 = Vector{<:Number}[] # 0-element Vector{Vector{<:Number}}
push!(vv1, v1) # 1-element Vector{Vector{<:Number}}
push!(vv1, v2) # 2-element Vector{Vector{<:Number}}
vv2 = Vector{Int64}[] # 0-element Vector{Vector{Int64}}
push!(vv2, v1) # 1-element Vector{Vector{Int64}}
push!(vv2, v2) # Error: vv2 container can only hold Vector{Int64} elements
vv1 isa Vector{Vector{<:Number}} # true
vv2 isa Vector{Vector{<:Number}} # false
vv1 isa Vector{<:Vector{<:Number}} # true
vv2 isa Vector{<:Vector{<:Number}} # true

```

I asked a related question [here](https://discourse.julialang.org/t/vector-of-vectors-type-issue-and-tuple-question/46640) which may also be useful to you.

---

_[View the full topic](https://discourse.julialang.org/t/why-1-2-3-is-not-a-vector-number/52645)._
