On Friday, March 27, 2015 at 7:26:54 AM UTC+5:30, Chris Angelico wrote: > On Fri, Mar 27, 2015 at 12:41 PM, Rustom Mody 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.
Well maybe... I dont the ABC thing very well in python. [It does seem to be underutilized] Anyway my point is that in python (after 2.2??) saying something is an object is a bit of a tautology -- ie verbiage without information. Note: We are not talking of the *fact* that something -- in this case filter -- subclasses object, but the output of help(filter) -- https://mail.python.org/mailman/listinfo/python-list