slicings: 3 questions

Alan G Isaac alan.isaac at gmail.com
Thu Jan 29 15:39:49 EST 2009


> On Thu, Jan 29, 2009 at 10:01 AM, Alan G Isaac <alan.isaac at gmail.com> wrote:
>> 1. I seem not to understand something obvious at
>> http://docs.python.org/3.0/reference/expressions.html#slicings
>> (I assume I'm just not reading this right.)
>> What is an example of a slicing using a "slice_list"?


On 1/29/2009 1:37 PM Chris Rebert apparently wrote:
> There's nothing in the stdlib that uses it IIRC, but for instance a
> matrix package could allow you to do:
> 
> a = Matrix(12,12,12) #make a 3D cubic matrix of all 0s
> print( a[4,2,6] ) #get an item from the matrix using slice_list syntax
> print( a[4][2][6] ) #another way to get the same item


Ah sure, I was misreading it.
It is just enabling NumPy style indexing.
I was assuming that it was describing a legitimate
way so slice sequences generally.

Thanks,
Alan



More information about the Python-list mailing list