[Python-ideas] Where did we go wrong with negative stride?

Antoine Pitrou solipsis at pitrou.net
Mon Oct 28 15:42:05 CET 2013


Le Mon, 28 Oct 2013 09:57:43 -0400,
Brett Cannon <brett at python.org> a écrit :
> > >
> > > > but a[-1:-6:-1] would be deprecated.
> > >
> > > Not sure I've _ever_ seen that in real life.
> >
> > If it's never seen in real life, then there's probably no urge to
> > deprecate it and later replace it with a new thing, IMHO.
> >
> 
> I think there is to minimize even the chance someone has done
> something like this since it's so wonky. We all know someone has
> somewhere in code out in the world.

But that code probably works anyway. It's slightly unintuitive to write
but it works afterwards. I think there's a tension here between
discouraging new uses of the feature, and breaking existing uses.

Regards

Antoine.




More information about the Python-ideas mailing list