[Python-Dev] non-integer arguments to simple slices in 1.6?

Gordon McMillan gmcm@hypernet.com
Mon, 10 Jul 2000 10:41:37 -0400


[Guido]
> I got the following email from Scott Johnston which suggests an
> interesting idea (for 2.0, of course, as that's what we're all
> working on now).  basically, Scott proposes to deprecate
> __getslice__ (and its friends, __setslice__ and __delslice__) in
> favor of passing the slice arguments unadorned to __getitem__  if
> __getslice__ is not defined.
> 
> On the surface, this seems reasonable to me, except that it
> doesn't help for extension classes...

We have a problem here, but I think it's in the fact that 
currently certain slices end up in __getitem__ and some in 
__getslice__.

IOW, I think that __getitem__ should return an item, and this 
fix (while clever) just compounds a mistake.


- Gordon