# Incomplete tuples

**URL:** <https://discourse.julialang.org/t/incomplete-tuples/6214>\
**Category:** General Usage\
**Created:** [October 3, 2017, 10:38am UTC](https://discourse.julialang.org/t/incomplete-tuples/6214 "2017-10-03T10:38:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [October 3, 2017, 10:38am UTC](https://discourse.julialang.org/t/incomplete-tuples/6214/1 "2017-10-03T10:38:27Z")

</div>

If I define a vector as a=[2,3] then its size() is returned as an incomplete tuple (2,). The transpose of a has a size of (1,2). Do not problems arise from the fact that (2,) == (2,1) returns false?

---

<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:** [October 3, 2017, 10:51am UTC](https://discourse.julialang.org/t/incomplete-tuples/6214/2 "2017-10-03T10:51:04Z")

</div>

`(2,)` is simply syntax for a tuple of 1 element. There is nothing “incomplete” about it. The `,` is needed to avoid confusion with `(2) == 2`.

---

<div class="post-metadata">

**Author:** ![avik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avik/32/17_2.png) [@avik](https://discourse.julialang.org/u/avik)\
**Post date:** [October 3, 2017, 11:03am UTC](https://discourse.julialang.org/t/incomplete-tuples/6214/3 "2017-10-03T11:03:15Z")

</div>

To clarify the underlying issue this a little more,

`[2,3]` is a vector, it only has one dimension. It’s transpose is a matrix, ie, it has two dimensions, the length of the second dimension happens to be 1. Therefore, it is correct that `(2,) !== (2,1)` Unlike some other languages, Julia has a separate concept for a `Vector`, it is not just a `Matrix` of one column. This has been much debated, and this has been considered to be very useful.

---

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [October 3, 2017, 4:48pm UTC](https://discourse.julialang.org/t/incomplete-tuples/6214/4 "2017-10-03T16:48:39Z")

</div>

Thanks for these great answers. Given the dimensions issues, I note that size([2,3])[2] produces an error as it tries to access the dimension that does not exist in the tuple, but size([2,3],2) “pretends” that that dimension has length 1. I guess it is a matter of knowing what you can use. There are times when one starts out with a matrix, but it might unexpectedly become a column vector as a result of operations.

---

<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:** [October 3, 2017, 5:23pm UTC](https://discourse.julialang.org/t/incomplete-tuples/6214/5 "2017-10-03T17:23:17Z")

</div>

Padding sizes with `1`s was [decided](https://github.com/JuliaLang/julia/issues/306) and [implemented](https://github.com/JuliaLang/julia/commit/db7df1443723c8a1cc22be0687afab29bdb99fba) very early, but I am surprised that the docstring of `size` does not document this. Perhaps consider checking if there is an issue (I could not find anything related, but only looked quickly), and if not, open one.

---

<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:** [October 4, 2017, 7:46am UTC](https://discourse.julialang.org/t/incomplete-tuples/6214/6 "2017-10-04T07:46:54Z")

</div>

Opened an issue  
[https://github.com/JuliaLang/julia/issues/23985](https://github.com/JuliaLang/julia/issues/23985)
