Supply condition in function call

Rustom Mody rustompmody at gmail.com
Thu Mar 26 22:46:28 EDT 2015


On Friday, March 27, 2015 at 7:56:16 AM UTC+5:30, Ian wrote:
> On Thu, Mar 26, 2015 at 7:56 PM, Chris Angelico  wrote:
> >> On a more specific note, its the 1st line:
> >>
> >> class filter(object)
> >>
> >> which knocks me off.
> >> If a more restricted type from the ABC was shown which exactly captures all
> >> the iterator-specific stuff like __iter__, __next__ it would sure help (me)
> >
> > But there's no point in subclassing for everything. In this case,
> > filter doesn't subclass anything but object, so there's no value in
> > stating anything else. You want to know if it's iterable? Check for an
> > __iter__ method. Etcetera.
> 
> Also, filter is a builtin, while collections.abc.Iterable is in a
> library module written in Python, so there's a bootstrapping problem
> with having the one inherit from the other.

As I said to Chris, I am not talking of the facts but of the docs



More information about the Python-list mailing list