Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'class,': 0.07; 'none,': 0.07; 'python3': 0.07; 'string': 0.09; 'defines': 0.09; 'handful': 0.09; 'type,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; "(it's": 0.16; '2.7.3': 0.16; '[and': 0.16; 'btw': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterable': 0.16; 'iterable)': 0.16; 'iterator': 0.16; 'tuple': 0.16; 'tuple,': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'string,': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'class': 0.32; 'linux': 0.33; 'received:google.com': 0.35; 'sequence': 0.36; 'method': 0.36; 'list.': 0.37; 'filter': 0.38; 'list,': 0.38; 'pm,': 0.38; 'does': 0.39; 'here:': 0.62; 'mar': 0.68; '26,': 0.68; '2014,': 0.84; '2015': 0.84; 'comparable': 0.84; 'describes': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=HM2GScmgGD4AA2cIxmPwCIZielhJ9whozNtMAiq4u6Q=; b=itNN3gJDvp7L5+WN0udy7RbFugPLJhh967uZwmoQnED1agQChs4TdVOTHUi/kFfoRG HtsEQW+qMvWsi1ra0QsP/xpFHcI/S5THvaGUaIllulujlnyUeSjxQVELcII/iYBnHfXB HfznriYY9ePHEdf15m+ovhhpIVjHxLuAWd82ZbI7eZ8cTEHwE4I3FZ3GxR8zllFaL2th iQ8WDbaLkDfrnSfhrEpCnfA5s4vj825G2A667mZGv/6zefCM3j2FcfrxYGqrDdvk8OU+ U99mDqLBOVTokHiZx+SSV9plIOgtkwYHRRmBlD5uAeCVG9MMwKQ/OA42ZLx6Vlq2Kf08 nMuQ== MIME-Version: 1.0 X-Received: by 10.107.16.31 with SMTP id y31mr18591485ioi.53.1427349634032; Wed, 25 Mar 2015 23:00:34 -0700 (PDT) In-Reply-To: <9b6f41d0-e27e-4e0b-b04d-d15627667330@googlegroups.com> References: <87bnjhyohp.fsf@uriel.graune.org> <9b6f41d0-e27e-4e0b-b04d-d15627667330@googlegroups.com> Date: Thu, 26 Mar 2015 17:00:33 +1100 Subject: Re: Supply condition in function call From: Chris Angelico Cc: "python-list@python.org" 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427349642 news.xs4all.nl 2925 [2001:888:2000:d::a6]:40458 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88028 On Thu, Mar 26, 2015 at 3:02 PM, Rustom Mody wrote: > [And BTW > help(filter) in python2 is much better documention than in python3 > ] Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 filter(...) filter(function or None, sequence) -> list, tuple, or string Return those items of sequence for which function(item) is true. If function is None, return the items that are true. If sequence is a tuple or string, return the same type, else return a list. Python 3.5.0a0 (default:4709290253e3, Jan 20 2015, 21:48:07) [GCC 4.7.2] on linux class filter(object) | filter(function or None, iterable) --> filter object | | Return an iterator yielding those items of iterable for which function(item) | is true. If function is None, return the items that are true. | | Methods defined here: (chomp a handful of method details) Looks pretty comparable to me. Py2 clearly stipulates that it's a function that returns a tuple, string, or list. Py3 defines it as a class, and then describes what it does (it's an iterator) and then its methods. ChrisA