Possible improvement to slice opperations.

Ron Adam rrr at ronadam.com
Mon Sep 5 12:48:00 EDT 2005


Fredrik Lundh wrote:

> Steve Holden wrote:
> 
> 
>>Yes, I've been surprised how this thread has gone on and on.
> 
> 
> it's of course a variation of
> 
>     "You can lead an idiot to idioms, but you can't make him
>     think ;-)"
> 
> as long as you have people that insist that their original misunderstandings
> are the only correct way to model the real world, and that all observed
> inconsistencies in their models are caused by bugs in the real world, you'll
> end up with threads like this.
> 
> </F> 

Ok, -1 from both Fredrik and Steven

No problem,

But I think you are mistaken that I don't understand how slicing works. 
(IMHO of course) ;-)


A more valid argument against this would be that more users may prefer 
the current zero based, select to the right, indexing than have to 
remember to subtract one from negative index's or use '~'.

I'm completely aware of that, and don't argue that that viewpoint is valid.

It also has backwards compatibility issues as well.  Which is probably 
enough in itself to kill it as a PEP.


However, I would like the inverse selection of negative strides to be 
fixed if possible.  If you could explain the current reason why it does 
not return the reverse order of the selected range.  I would appreciated it.

Cheers,
Ron











More information about the Python-list mailing list