# About acceptable types of dimension parameter for Base.reshape

**URL:** https://discourse.julialang.org/t/about-acceptable-types-of-dimension-parameter-for-base-reshape/18091
**Category:** General Usage
**Created:** [November 28, 2018, 9:51am UTC](https://discourse.julialang.org/t/about-acceptable-types-of-dimension-parameter-for-base-reshape/18091 "2018-11-28T09:51:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![machakann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/machakann/32/3914_2.png) [@machakann](https://discourse.julialang.org/u/machakann)
#### Post date: [November 28, 2018, 9:51am UTC](https://discourse.julialang.org/t/about-acceptable-types-of-dimension-parameter-for-base-reshape/18091/1 "2018-11-28T09:51:50Z")

</div>

I think the current behavior of Base.reshape function is a little strange.

```julia
a = zeros(100);

reshape(a, 10, 10) # OK

reshape(a, UInt(10), UInt(10)) # MethodError
reshape(a, (UInt(10), UInt(10))) # OK

reshape(a, Int128(10), Int128(10)) # MethodError
reshape(a, (Int128(10), Int128(10))) # OK

```

Probably it would be ok if reshape() accepts those parameters in both cases. Or am I missing something?

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [November 28, 2018, 9:58am UTC](https://discourse.julialang.org/t/about-acceptable-types-of-dimension-parameter-for-base-reshape/18091/2 "2018-11-28T09:58:40Z")

</div>

Array indexing and dimensions are based on `Int`, thus it is a bit strange to use something else. But it would probably be ok to change the definition from

```julia
reshape(parent::AbstractArray, dims::Int...) = reshape(parent, dims)

```

to

```julia
reshape(parent::AbstractArray, dims::Integer...) = reshape(parent, dims)

```

Why don’t you do a PR to find out?

---

<div class="post-metadata">

### Author: ![machakann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/machakann/32/3914_2.png) [@machakann](https://discourse.julialang.org/u/machakann)
#### Post date: [November 28, 2018, 10:07am UTC](https://discourse.julialang.org/t/about-acceptable-types-of-dimension-parameter-for-base-reshape/18091/3 "2018-11-28T10:07:09Z")

</div>

Thank you! I will try.
