[Python-ideas] slice.literal notation

Ethan Furman ethan at stoneleaf.us
Wed Jun 10 21:16:42 CEST 2015


On 06/10/2015 08:33 AM, Joseph Jevnik wrote:

> The basic idea is to provide an alternative constructor to 'slice' that uses
>  the subscript syntax. This allows people to write more understandable code.

+1


> 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.

--
~Ethan~


More information about the Python-ideas mailing list