[Python-3000] Thoughts on collections.Container and collections.Iterable

Neil Toronto ntoronto at cs.byu.edu
Sat Feb 9 06:30:08 CET 2008


Neil Toronto wrote:
> Guido van Rossum wrote:
>> I would need to think more about this. I'm tempted not to do this, and
>> let these ABCs denote the *explicit* presence of __contains__ and
>> __iter__, respectively. Something that's iterable but doesn't
>> implement __contains__ supports the 'in' operator very inefficiently
>> (through linear search) which we might not want to encourage.
> It could be worse. Is a container necessarily finite?

I meant an iterable, of course, not a container.

Neil


More information about the Python-3000 mailing list