[Python-ideas] Introduce collections.Reiterable

Steven D'Aprano steve at pearwood.info
Sat Sep 21 10:02:17 CEST 2013

On Sat, Sep 21, 2013 at 02:21:21AM -0400, Neil Girdhar wrote:
> No one suggested removing __getitem__.  Some people have suggested
> deprecating (without removing) the sequence protocol.

Some people -- that would be you, I believe.

What's the point of deprecating something if you have no intention of 
removing it?

What's the point of deprecating something which works? It isn't like 
it's doing any harm. You'll just cause unnecessary code-churn in other 
people's working code. Removing broken, unfixable code -- sure. Removing 
working code just because it annoys some people's idea of purity? I'm 
against that.

> 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__)?

Not off the top of my head, but that doesn't mean there aren't masses of 
code that does so. Off the top of my head, I don't know of any code that 
relies on exception tracebacks being printed to stderr rather that 
stdout, but that doesn't mean we should feel free to change that on a 


More information about the Python-ideas mailing list