On Wed, Oct 28, 2020 at 2:44 PM bas van beek <bas.vanbeek@hotmail.com> wrote:

Hey all,

 

With the recent merging of numpy/numpy#16759 we’re at the point where `ndarray` can be made generic w.r.t. its dtype and shape.

An open question which yet remains is to order in which these two parameters should appear (numpy/numpy#16547):

·         `ndarray[Dtype, Shape]`

·         `ndarray[Shape, Dtype]`


Hi Bas,

Thanks for driving this forward!

Just to speak for myself, I don't think the precise choice matters very much. There are arguments for consistency both ways. In the end Dtype and Shape are different enough that I doubt it will be a point of confusion.

Also, I would guess many users will define their own type aliases, so can write something more succinct like Float64[shape] rather than ndarray[float64, shape].  We might even consider including some of these in numpy.typing.

Cheers,
Stephan
 
 

 

There has been a some discussion about this question in issue 16547, but a consensus has not yet to be reached.

Most people seem to slightly preferring one option over the other.

 

Are there any further thoughts on this subject?

 

Regards,

Bas van Beek

 

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion