[Python-ideas] Where did we go wrong with negative stride?
Robert Kern
robert.kern at gmail.com
Tue Oct 29 12:26:49 CET 2013
On 2013-10-29 00:41, Tim Peters wrote:
> When you see things like
>
> s[i:j;k] = s[i:j][::k]
>
> *nobody* is suggesting using the spelling on the RHS. They're
> pointing out a pleasant mathematical equivalence.
Actually, I am suggesting that, in the case of negative k. It is much easier to
learn, read, and reason about the composition of those two operations than any
[i:j:k] construction, not matter what semantics you apply to that syntax.
That said, I always use this in numpy where slices are practically free.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-ideas
mailing list