[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-10-01 Thread Evgeni Burovski via NumPy-Discussion
> > Given that we've already chosen to use the fake `shape=...` keyword when > there is a 0-length axis, what do you think we should do, consistency-wise? > > >>> np.empty([10, 0]) > array([], shape=(10, 0), dtype=float64) > > 1. Follow the precedent and use the fake `shape=...` keyword in the > su

[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-10-01 Thread Evgeni Burovski via NumPy-Discussion
I like this, too. And I think the trailing comment, # shape=... is much better, as it gets the best of both worlds: user get the info, and tools which do eval(repr(..)) only need to learn to ignore the comment. For one, numpy's own doctests will keep working with no churn since scipy_doctest handl