Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: Pylint prefers list comprehension over filter... Date: Tue, 10 May 2016 15:47:07 -0400 Lines: 24 Message-ID: References: <572BF2BF.6000000@icloud.com> <1462498631.232041.599637409.25D91C08@webmail.messagingengine.com> <572E3F53.5010703@icloud.com> <5731f70f$0$1590$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1I5KBeZpzyt6b/o8GU5p4QhILinixCHohPCZaPN+xtKQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'builtin': 0.07; 'subject:skip:c 10': 0.07; 'added.': 0.09; 'bool': 0.09; 'extension,': 0.09; 'newly': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'separately': 0.09; 'jan': 0.11; 'argument': 0.15; 'expression.': 0.16; 'iterable)': 0.16; 'lambda': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'unneeded': 0.16; 'wrote:': 0.16; 'hack': 0.18; '(not': 0.20; 'trying': 0.22; 'am,': 0.23; 'split': 0.23; 'header :In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'subject:list': 0.26; 'header:X-Complaints-To:1': 0.26; 'point.': 0.27; 'function': 0.28; 'looks': 0.29; "we're": 0.30; 'checks': 0.30; 'another': 0.32; 'good.': 0.32; 'next': 0.35; 'should': 0.36; 'instead': 0.36; 'created': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'release': 0.37; 'to:addr:python.org': 0.40; 'email addr:gmail.com': 0.62; 'introduction': 0.63; 'received:96': 0.63; 'attention': 0.76; 'subject:over': 0.84; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-96-227-207-81.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <572BF2BF.6000000@icloud.com> <1462498631.232041.599637409.25D91C08@webmail.messagingengine.com> <572E3F53.5010703@icloud.com> <5731f70f$0$1590$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:108487 On 5/10/2016 11:35 AM, pcmanticore@gmail.com wrote: > The bad-builtin check is now an extension, so using the first case > would enable it. The 'old' (not 'bad') builtin check should include using map instead of a comprehension. The check should also pay attention to whether the function argument is an existing function or a one newly created with a lambda expression. "'lambda' in " I think filter(None, iterable) (== filter(bool, iterable)) should be separately flagged as a style point. It is a hack that became unneeded when bool was added. > Another thing that is going to change with the next release is > the introduction of tiers. Basically, pylint overwhelms the user > right now with its enabled checks and we're trying to split these > into tiers, as seen in the following: This looks good. -- Terry Jan Reedy