# DataType and Type{T}

**URL:** <https://discourse.julialang.org/t/datatype-and-type-t/57082>\
**Category:** New to Julia\
**Tags:** parametric-types\
**Created:** [March 13, 2021, 4:34pm UTC](https://discourse.julialang.org/t/datatype-and-type-t/57082 "2021-03-13T16:34:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [March 13, 2021, 4:34pm UTC](https://discourse.julialang.org/t/datatype-and-type-t/57082/1 "2021-03-13T16:34:11Z")

</div>

I don’t understand the following:

```julia
julia> String isa Type{String}
true

julia> ("abc", String) isa Tuple{String, Type{String}} # ?
false

julia> ("abc", String) isa Tuple{String, Type{T} where T}
true

julia> ("abc", String) isa Tuple{String, DataType}
true

```

The second one is the one I would like. I think 3d and 4th are equivalent. The slightly broader context is a data structure which contains maps of the type `:abc => (value, typeof(value))`; I can type the dictionary

```nohighlight
julia> Dict{Symbol, Tuple{T, DataType} where T}(
           :abc => (2, Int),
           :def => ("hello", String)
       )
Dict{Symbol, Tuple{T, DataType} where T} with 2 entries:
  :abc => (2, Int64)
  :def => ("hello", String)

```

but not

```nohighlight
julia> Dict{Symbol, Tuple{T, Type{T}} where T}(
           :abc => (2, Int),
           :def => ("hello", String)
       )
ERROR: TypeError: in arrayset, expected Tuple{T, Type{T}} where T, got a value of type Tuple{Int64, DataType}

```

I can work around this / do this differently but I’m curious as to why this doesn’t work; is it the same as [DataType with type parameter](https://discourse.julialang.org/t/datatype-with-type-parameter/17932/1) and the reference to the issue [redesign typeof(::Type) · Issue #29368 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/29368) ?

Thanks

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [March 13, 2021, 6:57pm UTC](https://discourse.julialang.org/t/datatype-and-type-t/57082/2 "2021-03-13T18:57:09Z")

</div>

> [@tlienart](#):
>
> is it the same as [DataType with type parameter](https://discourse.julialang.org/t/datatype-with-type-parameter/17932/1) and the reference to the issue [redesign typeof(::Type) · Issue #29368 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/29368) ?

Yes.
