Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #108299 > unrolled thread

Re: Pylint prefers list comprehension over filter...

Started byStephen Hansen <me@ixokai.io>
First post2016-05-07 14:35 -0700
Last post2016-05-08 12:53 +1000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Pylint prefers list comprehension over filter... Stephen Hansen <me@ixokai.io> - 2016-05-07 14:35 -0700
    Re: Pylint prefers list comprehension over filter... Steven D'Aprano <steve@pearwood.info> - 2016-05-08 12:53 +1000

#108299 — Re: Pylint prefers list comprehension over filter...

FromStephen Hansen <me@ixokai.io>
Date2016-05-07 14:35 -0700
SubjectRe: Pylint prefers list comprehension over filter...
Message-ID<mailman.476.1462656953.32212.python-list@python.org>
On Sat, May 7, 2016, at 12:17 PM, Christopher Reimer wrote:
> 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.

Bear in mind, when I say, "Pylint is opinionated", I mean the tool --
especially in its default configuration -- has its own opinion of what
is good style, and *I think its wrong on a number of points*. 

Its fine to use, but I'd read over PEP8 (the document, not the tool) and
apply style guide recommendations thoughtfully, not mechanically. 

-- 
Stephen Hansen
  m e @ i x o k a i  . i o

[toc] | [next] | [standalone]


#108322

FromSteven D'Aprano <steve@pearwood.info>
Date2016-05-08 12:53 +1000
Message-ID<572eaa3d$0$1586$c3e8da3$5496439d@news.astraweb.com>
In reply to#108299
On Sun, 8 May 2016 07:35 am, Stephen Hansen wrote:

> I'd read over PEP8 (the document, not the tool) and
> apply style guide recommendations thoughtfully, not mechanically.


Guido is not a fan of automated PEP8 checkers. He agrees entirely with your
comment: apply style guides thoughtfully, not mechanically.

(Cannot be repeated often enough.)


-- 
Steven

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web