[Python-ideas] __iter__ implies __contains__?
Chris Rebert
pyideas at rebertia.com
Sun Oct 2 03:21:04 CEST 2011
On Sat, Oct 1, 2011 at 6:14 PM, Steven D'Aprano <steve at pearwood.info> wrote:
<snip>
> Requiring collection to explicitly inherit from a Sequence ABC breaks duck
> typing and is anti-Pythonic.
Actually, my suggestion was just that Sequence is one possible (but
clean) way to obtain the behavior; one could *of course* reimplement
the functionality without recourse to Sequence if they desired.
Cheers,
Chris
More information about the Python-ideas
mailing list