[Numpy-tickets] [NumPy] #468: Use ellipses to auto complete indices for slice assignments

NumPy numpy-tickets@scipy....
Wed Mar 14 16:34:27 CDT 2007


#468: Use ellipses to auto complete indices for slice assignments
-------------------------+--------------------------------------------------
 Reporter:  jlagarde     |       Owner:  somebody
     Type:  enhancement  |      Status:  new     
 Priority:  lowest       |   Milestone:          
Component:  numpy.core   |     Version:          
 Severity:  minor        |    Keywords:          
-------------------------+--------------------------------------------------
 I have not used numpy fro that long and I apologize if this is a
 completely stupid idea, but it seems that the slice assignment

 a[4:4+len(b)] = b

 is a common use case (for me anyway). It would be a nice convenience if
 the ellipses notation could be used to mean "as many as required" in this
 context as well, i.e.

 a[4:...] = b, or a![...:10] = b

 There would be no confusion with the other use of ellipses because in this
 case they would be immediately next to the colon. I have not spent much
 time thinking of the multidimentional case, but think it would
 conceptually work also, i.e.

 a[4:...,...:-3] = b

 Of course, a shape mismatch error would still occur if there is just not
 enough room in "a" to fit "b" at the requested indices.

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/468>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list