[Python-Dev] Three argument slices.

Michael Hudson mwh21@cam.ac.uk
04 Nov 2000 16:47:31 +0000


bckfnn@worldonline.dk (Finn Bock) writes:

> Hi,
> 
> While updating the difference page in the Jython documentation, I
> came across this:
> 
> - JPython sequences support three argument slices. i.e. 
>   range(3)[::-1] == [2,1,0]. 
>   CPython should be fixed.
> 
> Is this actually true? Should (and will cpython) change in this
> respect?

Well, there's a patch I wrote on sf to add this to CPython, but it was
too late for 2.0 and it got postponed.

Does J[P]ython allow

l = range(10)
l[::3] = range(4)

?  That's one of the odder bits of the behaviour of my patch.

awaiting-pronouncement-(or-even-consensus)-ly y'rs
m.

-- 
58. Fools ignore complexity. Pragmatists suffer it. Some can avoid
    it. Geniuses remove it.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html