[Python-ideas] Introduce collections.Reiterable
Neil Girdhar
mistersheik at gmail.com
Sat Sep 21 09:03:35 CEST 2013
We're not talking about deprecating __getitem__. We're talking about
deprecating the "sequence protocol" whereby iter(obj) falls back to calling
__getitem__ when an object doesn't have __iter__. No one is talking about
removing __getitem__!
Neil
On Sat, Sep 21, 2013 at 2:36 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 09/20/2013 11:21 PM, Neil Girdhar wrote:
>
>> No one suggested removing __getitem__. Some people have suggested
>> deprecating (without removing) the sequence protocol.
>> Do you know of any object that relies on the sequence protocol? That
>> is, that implements __getitem__ without
>> implementing __iter__ (or using a mixin like collections.Sequence to
>> provide __iter__)?
>>
>
> The goal of deprecation is removal.
>
> Any item that supports index access, such as lists, tuples, and
> dictionaries, needs __getitem__. Iteration is not the only way to access
> an iterable object.
>
>
> --
> ~Ethan~
> ______________________________**_________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/**mailman/listinfo/python-ideas<https://mail.python.org/mailman/listinfo/python-ideas>
>
> --
>
> --- You received this message because you are subscribed to a topic in the
> Google Groups "python-ideas" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/**
> topic/python-ideas/**OumiLGDwRWA/unsubscribe<https://groups.google.com/d/topic/python-ideas/OumiLGDwRWA/unsubscribe>
> .
> To unsubscribe from this group and all its topics, send an email to
> python-ideas+unsubscribe@**googlegroups.com<python-ideas%2Bunsubscribe at googlegroups.com>
> .
> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130921/63266a62/attachment.html>
More information about the Python-ideas
mailing list