# What is a DataType exactly and why isn't a Vector a DataType?

**URL:** <https://discourse.julialang.org/t/what-is-a-datatype-exactly-and-why-isnt-a-vector-a-datatype/18727>\
**Category:** General Usage\
**Created:** [December 16, 2018, 11:01pm UTC](https://discourse.julialang.org/t/what-is-a-datatype-exactly-and-why-isnt-a-vector-a-datatype/18727 "2018-12-16T23:01:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [December 16, 2018, 11:01pm UTC](https://discourse.julialang.org/t/what-is-a-datatype-exactly-and-why-isnt-a-vector-a-datatype/18727/1 "2018-12-16T23:01:33Z")

</div>

Topic says it all.  
Thanks

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [December 16, 2018, 11:36pm UTC](https://discourse.julialang.org/t/what-is-a-datatype-exactly-and-why-isnt-a-vector-a-datatype/18727/2 "2018-12-16T23:36:40Z")

</div>

An instance of `Vector{T}` object is an `Array{T,1}`, but `Vector{T}` itself is a `DataType`.

```nohighlight
julia> typeof(Vector{Any})
DataType

julia> typeof(Vector{Any}())
Array{Any,1}

julia> typeof(ans)
DataType

```

---

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [December 16, 2018, 11:43pm UTC](https://discourse.julialang.org/t/what-is-a-datatype-exactly-and-why-isnt-a-vector-a-datatype/18727/3 "2018-12-16T23:43:42Z")

</div>

I see, then Unions are not DataTypes.

```nohighlight
julia> Vector isa DataType
false

julia> Vector{Any} isa DataType
true

```

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [December 16, 2018, 11:46pm UTC](https://discourse.julialang.org/t/what-is-a-datatype-exactly-and-why-isnt-a-vector-a-datatype/18727/4 "2018-12-16T23:46:27Z")

</div>

Seems you are right,

```nohighlight
julia> typeof(Vector) |> supertype
Type{T}

julia> Vector isa Type
true

julia> Vector{Any} isa Type
true

```

They are of type `Type` instead of `DataType`.

---

<div class="post-metadata">

**Author:** ![jeff.bezanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff.bezanson/32/48_2.png) [@jeff.bezanson](https://discourse.julialang.org/u/jeff.bezanson)\
**Post date:** [December 17, 2018, 2:59am UTC](https://discourse.julialang.org/t/what-is-a-datatype-exactly-and-why-isnt-a-vector-a-datatype/18727/5 "2018-12-17T02:59:38Z")

</div>

Correct; a type like `Vector{Int}` is a `DataType` because it has concrete properties like memory layout. `Vector` on the other hand expresses the union of `Vector{T}` types for all values of `T`, so it’s a more abstract concept.
