# Are integers immutable and are they acceptable as keys in

**URL:** https://discourse.julialang.org/t/are-integers-immutable-and-are-they-acceptable-as-keys-in/56816
**Category:** General Usage
**Created:** [March 9, 2021, 3:50pm UTC](https://discourse.julialang.org/t/are-integers-immutable-and-are-they-acceptable-as-keys-in/56816 "2021-03-09T15:50:30Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [March 9, 2021, 3:57pm UTC](https://discourse.julialang.org/t/are-integers-immutable-and-are-they-acceptable-as-keys-in/56816/2 "2021-03-09T15:57:28Z")

</div>

> [@anon60034542](#):
>
> Are integers really immutable? Can they safely be used as keys in a dictionary?

Yes and yes (assuming you mean some concrete type like `Int` or `Int64` or `Int32`). In fact, `Int`s are “bits” types, which is an even stricter subset of immutability:

```julia
help?> isbitstype
search: isbitstype

  isbitstype(T)

  Return true if type T is a "plain data" type, meaning it is immutable and contains no references to other values,
  only primitive types and other isbitstype types. 

```

```julia
julia> isbitstype(Int)
true

```

---

_[View the full topic](https://discourse.julialang.org/t/are-integers-immutable-and-are-they-acceptable-as-keys-in/56816)._
