# Why does Tuple not have AbstractVector semantics?

**URL:** https://discourse.julialang.org/t/why-does-tuple-not-have-abstractvector-semantics/82237
**Category:** Internals & Design
**Tags:** tuple
**Created:** [June 4, 2022, 2:46pm UTC](https://discourse.julialang.org/t/why-does-tuple-not-have-abstractvector-semantics/82237 "2022-06-04T14:46:07Z")
**Posts on this page:** 1
**Page:** 2

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [June 9, 2022, 9:37pm UTC](https://discourse.julialang.org/t/why-does-tuple-not-have-abstractvector-semantics/82237/21 "2022-06-09T21:37:30Z")

</div>

> [@jakobnissen](#):
>
> That is, what is the value of T in `Tuple{String, UInt, Char} <: AbstractVector{T}`? What is the element type?

While I agree that making `Tuple` an abstract vector is probably misguided, the covariance of Tuples actually makes this easy to answer: `T = typejoin(String, UInt, Char)`.

```julia
julia> Tuple{String, UInt, Char} <: NTuple{3, Base.typejoin(String, UInt, Char)}
true

```

The above typejoin happens to be `Any`, but that’s exactly what you also get when you use a vector as well.

```julia
julia> ["hi", UInt(1), 'c']
3-element Vector{Any}:
                   "hi"
 0x0000000000000001
                   'c': ASCII/Unicode U+0063 (category Ll: Letter, lowercase)

```

Though of course, `NTuple{N, typejoin(...)}` will disagree with `Vector` once you get into promotion, e.g.

```julia
julia> [1, 1.0-im]
2-element Vector{ComplexF64}:
 1.0 + 0.0im
 1.0 - 1.0im

julia> typejoin(Int, ComplexF64)
Number

```

[Previous page](https://discourse.julialang.org/t/why-does-tuple-not-have-abstractvector-semantics/82237.md?page=1)
