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

Neil Toronto ntoronto at cs.byu.edu
Sat Feb 9 06:04:17 CET 2008


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?

Neil



More information about the Python-3000 mailing list