Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Reimer Newsgroups: comp.lang.python Subject: Re: Pylint prefers list comprehension over filter... Date: Sat, 07 May 2016 12:17:39 -0700 Lines: 18 Message-ID: References: <572BF2BF.6000000@icloud.com> <1462498631.232041.599637409.25D91C08@webmail.messagingengine.com> <572E3F53.5010703@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de klZET+KSR+lgOCjTUovDSw5aKOzrIAOaQ7tl7B+hoGTg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.056 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'reject': 0.05; 'subject:skip:c 10': 0.07; 'thu,': 0.15; 'happy.': 0.16; 'pythonic': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'first,': 0.20; 'stephen': 0.22; 'header:User-Agent:1': 0.26; 'subject:list': 0.26; 'chris': 0.26; 'received:17': 0.27; 'correct': 0.28; "i'm": 0.30; 'code': 0.30; '(i.e.,': 0.30; 'received:10.0.0': 0.32; 'options': 0.33; 'purposes,': 0.33; 'received:10.0': 0.34; 'list': 0.34; 'filter': 0.35; 'possible.': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'hiring': 0.37; 'thank': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'header:MIME- version:1': 0.60; 'default': 0.61; 'engine': 0.62; 'charset:windows-1252': 0.62; 'hand': 0.82; '"yes,': 0.84; 'header :In-reply-to:1': 0.84; 'subject:over': 0.84 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-07_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1605070286 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-reply-to: <1462498631.232041.599637409.25D91C08@webmail.messagingengine.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1462648660; bh=Onm/5yWDskAGsS6o6O818+7Vte8uH4jOQ103/pPOHaA=; h=Subject:To:From:Message-id:Date:MIME-version:Content-type; b=cCLbgIMFtzqwQfJ+qHOONuOxOujAzbc7cMTd+boiwnlzq05/Ezfi+VaOJ3WMYmaEF n6prBw66RplubAU7qVtqMudHc9macDjtMSIahYgmWppLvfWd11e3fexPqJLfinFzos 7qqjOlYEyEeol8fDfj9nlxU6DLMTWAk1TDpk5/75OTdLKM9EG40ra+ss/6o038AFDw jQMOnT4DEUruUWjNGFIHl5MorBGwFUnaLAziaIFQCnNLPm9T6sI+O3595QjLtlMSzu VoLui4GEKohiaFcngRT8Q2KKlOBYZbF6UBe+DdOtBZitesyP3D/xWpuUJjJaFptofa RwSqZbtM6xGXg== 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: <572E3F53.5010703@icloud.com> X-Mailman-Original-References: <572BF2BF.6000000@icloud.com> <1462498631.232041.599637409.25D91C08@webmail.messagingengine.com> Xref: csiph.com comp.lang.python:108293 On 5/5/2016 6:37 PM, Stephen Hansen wrote: > On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >> Which is one is correct (Pythonic)? Or does it matter? > First, pylint is somewhat opinionated, and its default options shouldn't > be taken as gospel. There's no correct: filter is fine. Since the code I'm working on is resume fodder (i.e., "Yes, I code in Python! Check out my chess engine code on GitHub!"), I want it to be as Pythonic and PEP8-compliant as possible. That includes scoring 10/10 with pylint. Never know when an asshat hiring manager would reject my resume out of hand because my code fell short with pylint. For my purposes, I'm using the list comprehension over filter to keep pylint happy. Thank you, Chris R.