[Python-ideas] __iter__ implies __contains__?

Masklinn masklinn at masklinn.net
Tue Oct 4 00:13:39 CEST 2011


On 2011-10-04, at 00:00 , Nick Coghlan wrote:
> 
> Basically, my understanding is that iterators started life as a way of
> generalising various operations on containers. This is reflected in
> the "for x in y: assert x in y" symmetry
Which interestingly enough will *not* work for iterables without
repeating elements.



More information about the Python-ideas mailing list