[Python-ideas] slice.literal notation

random832 at fastmail.us random832 at fastmail.us
Wed Jun 10 22:26:52 CEST 2015


On Wed, Jun 10, 2015, at 15:16, Ethan Furman wrote:
> On 06/10/2015 08:33 AM, Joseph Jevnik wrote:
> > There is a second change proposed here and that is to 'slice.__repr__'. This
> >  change makes the repr of a slice object match the new literal syntax to make
> >  it easier to read.
> 
> -1
> 
> Having the old repr makes it possible to see what the equivalent slice()
> spelling is.

How about a separate method, slice.as_index_syntax() that just returns
'::-1'?


More information about the Python-ideas mailing list