# A Union of Tuple types isa Tuple type ?!

**URL:** <https://discourse.julialang.org/t/a-union-of-tuple-types-isa-tuple-type/75339>\
**Category:** General Usage\
**Tags:** type\
**Created:** [January 28, 2022, 4:18am UTC](https://discourse.julialang.org/t/a-union-of-tuple-types-isa-tuple-type/75339 "2022-01-28T04:18:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Post date:** [January 28, 2022, 4:18am UTC](https://discourse.julialang.org/t/a-union-of-tuple-types-isa-tuple-type/75339/1 "2022-01-28T04:18:16Z")

</div>

So, what’s the rationale for the following behaviour, which caught me by surprise:

```julia
julia> Union{Tuple{Int}, Tuple{Char}} <: Tuple
true

```

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [January 28, 2022, 4:32am UTC](https://discourse.julialang.org/t/a-union-of-tuple-types-isa-tuple-type/75339/2 "2022-01-28T04:32:59Z")

</div>

Any instance of `Union{Tuple{Int}, Tuple{Char}}` is also an instance of `Tuple`. A simpler example is

```julia
julia> Union{Int32,Int64} <: Integer
true

```

But the title of your question says `isa`, which isn’t true:

```julia
julia> Union{Tuple{Int}, Tuple{Char}} isa Tuple
false

```

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [January 28, 2022, 4:36am UTC](https://discourse.julialang.org/t/a-union-of-tuple-types-isa-tuple-type/75339/3 "2022-01-28T04:36:09Z")

</div>

if everything in a Union `<: T`, then this Union `<: T`, after all, a Union is nothing but a “union” of types; Union should not be thought of as a type like Tuple or Set or Vector, similar to how `DataType` shouldn’t be thought as “ordinary” types like `Float64` or `Integer` (thus the special behavior)

---

<div class="post-metadata">

**Author:** ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Post date:** [January 28, 2022, 5:25am UTC](https://discourse.julialang.org/t/a-union-of-tuple-types-isa-tuple-type/75339/4 "2022-01-28T05:25:42Z")

</div>

> [@jzr](#):
>
> Any instance of `Union{Tuple{Int}, Tuple{Char}}` is also an instance of `Tuple` .

Yes, of course. Many thanks.
