# Should "1 ∈ 1" be "true"?

**URL:** <https://discourse.julialang.org/t/should-1-1-be-true/32914>\
**Category:** Internals & Design\
**Tags:** question, proposal\
**Created:** [January 3, 2020, 9:29am UTC](https://discourse.julialang.org/t/should-1-1-be-true/32914 "2020-01-03T09:29:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ibb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ibb/32/12083_2.png) [@Ibb](https://discourse.julialang.org/u/Ibb)\
**Post date:** [January 3, 2020, 9:29am UTC](https://discourse.julialang.org/t/should-1-1-be-true/32914/1 "2020-01-03T09:29:57Z")

</div>

I know it’s a trivial proposal, but, should a primitive type data object belong to(∈, in) itself? [_Axiom of regularity_](https://en.wikipedia.org/wiki/Axiom_of_regularity) implicates that “_No set is an element of itself_”.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [January 3, 2020, 9:38am UTC](https://discourse.julialang.org/t/should-1-1-be-true/32914/2 "2020-01-03T09:38:18Z")

</div>

Hmm, technically, 1 isn’t a set, so 1 isn’t an element of 1 it’s element of `{1}` though.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 3, 2020, 9:49am UTC](https://discourse.julialang.org/t/should-1-1-be-true/32914/3 "2020-01-03T09:49:51Z")

</div>

The docs for `in` say

> Determine whether an item is in the given collection, in the sense that it is == to one of the values generated by iterating over the collection.

In Julia, numbers are iterable:

```julia
julia> collect(1)
0-dimensional Array{Int64,0}:
1

```

and so `1 in 1` is true.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 3, 2020, 9:59am UTC](https://discourse.julialang.org/t/should-1-1-be-true/32914/4 "2020-01-03T09:59:47Z")

</div>

Numbers being iterable collections containing themselves is a quirk (wart, depending on your POV) in Julia. See the lengthy discussions in

[https://github.com/JuliaLang/julia/issues/11769](https://github.com/JuliaLang/julia/issues/11769)

[https://github.com/JuliaLang/julia/issues/7903](https://github.com/JuliaLang/julia/issues/7903)

[https://github.com/JuliaLang/julia/pull/19700](https://github.com/JuliaLang/julia/pull/19700)

I understand why this was not addressed for 1.0, and now it would be breaking, but I hope this is revisited at some point for 2.0.
