[Python-ideas] slice[] to get more complex slices

Joseph Jevnik joejev at gmail.com
Mon Jul 23 14:59:59 EDT 2018


I still think that 'operator.subscript' would be valuable to me for
all of the same reasons discussed in the previous threads and issues.
I don't understand why it was reverted without any serious discussion
given that it was already accepted and many people find this useful.

On Mon, Jul 23, 2018 at 2:38 PM, Serhiy Storchaka <storchaka at gmail.com> wrote:
> 23.07.18 18:16, Guido van Rossum пише:
>>
>> On Mon, Jul 23, 2018 at 3:24 AM, Jeroen Demeyer <J.Demeyer at ugent.be
>> <mailto:J.Demeyer at ugent.be>> wrote:
>>
>>     On 2018-07-23 11:58, Grégory Lielens wrote:
>>
>>         Not sure slice[1::3] can be done
>>
>>
>>     It can be done. Since "slice" is a class, it would require a
>>     metaclass though.
>>
>>
>> Since PEP 560 it won't need a metaclass -- it can be implemented as
>> __class_getitem__.
>
>
> Do you bless using __class_getitem__ for something other than typing?
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list