Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.054 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'python,': 0.02; 'method.': 0.07; 'line:': 0.09; 'stating': 0.09; 'subclass': 0.16; 'subclassing': 0.16; 'wrote:': 0.18; 'library': 0.18; 'module': 0.19; 'thu,': 0.19; 'written': 0.21; 'shown': 0.26; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'restricted': 0.31; 'class': 0.32; 'stuff': 0.32; 'problem': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'object,': 0.36; 'filter': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'more': 0.64; 'mar': 0.68; '26,': 0.68; '1st': 0.74; 'other.': 0.75; '2015': 0.84; 'abc': 0.84; 'captures': 0.84; 'everything.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=MpFh61oz4gDI4VVS7i9IU6a4sYvxZLQJ8L7N0tKsM1Q=; b=XaXo0cXgbCC+/6STiM2zHQ5i9SS1dKmwDgwEjcgKtB9YHAURGyCD9lnXqZCfQXIF2b BooUblT8ImPUisvikB4rsnQM+cAMbXs3Tvq/pKLqV5rhghtSDEHsUPRWFkTh/HkQ9S8Y RRoBaOy9RUFYoR1/WbV2j5q5p6jtw0Qp7ZypukMmeLUe8QFsB1fHeC3M/KaqNthj2UpL MeGwyWIRc7Dc9hPPdmtvt3gtRPS9TOIwN2wbkrw8bm7dbV+GVTM9gtAgNm16qwNND1nf U2d946IAbveZSCv+kj3DTTDYDk3TbR57H+3AVFMtYqExcOj+ksThnAqdmF2IIexNVo15 TxcA== X-Received: by 10.66.66.166 with SMTP id g6mr32071116pat.88.1427423157463; Thu, 26 Mar 2015 19:25:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <87bnjhyohp.fsf@uriel.graune.org> <9b6f41d0-e27e-4e0b-b04d-d15627667330@googlegroups.com> From: Ian Kelly Date: Thu, 26 Mar 2015 20:25:17 -0600 Subject: Re: Supply condition in function call To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427423166 news.xs4all.nl 2856 [2001:888:2000:d::a6]:47620 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4064 X-Received-Body-CRC: 3398569586 Xref: csiph.com comp.lang.python:88129 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.