Re: Method(s) called by square brackets, slice objects

2014-04-10 Thread Terry Reedy
On 4/10/2014 2:52 PM, John Ladasky wrote: Thanks to both Ethan and Steven for their replies. Steven: I was trying to use the interpreter and wasn't getting results that I understood -- because I didn't know that __getslice__ was simply gone in Python 3. I implemented a __getslice__ method in

Re: Method(s) called by square brackets, slice objects

2014-04-10 Thread John Ladasky
Thanks to both Ethan and Steven for their replies. Steven: I was trying to use the interpreter and wasn't getting results that I understood -- because I didn't know that __getslice__ was simply gone in Python 3. I implemented a __getslice__ method in my subclass that never got called. Ethan: I

Re: Method(s) called by square brackets, slice objects

2014-04-09 Thread Steven D'Aprano
On Wed, 09 Apr 2014 13:24:32 -0700, John Ladasky wrote: > I would like to build a multi-dimensional array that allows numpy-style > indexing and, ideally, uses Python's familiar square-bracket and slice > notations. > > For example, if I declare a two-dimensional array object, x, then x[4,7] > re

Re: Method(s) called by square brackets, slice objects

2014-04-09 Thread Ethan Furman
On 04/09/2014 01:24 PM, John Ladasky wrote: I would like to build a multi-dimensional array that allows numpy-style indexing and, ideally, uses Python's familiar square-bracket and slice notations. For example, if I declare a two-dimensional array object, x, then x[4,7] retrieves the element