Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread DFS
On 5/10/2016 3:34 PM, Terry Reedy wrote: On 5/10/2016 9:51 AM, Claudiu Popa wrote: Thank you for letting us know. While pylint is indeed opinionated in some cases, we're not trying to be "arrogant", as you put it, towards Guido or the other core developers. What's sad in this particular case

Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Chris Angelico
On Wed, May 11, 2016 at 1:35 AM, wrote: > 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: > > $ pylint myproject > # core checkers enabled > 10/10 - Congrats,

Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Terry Reedy
On 5/10/2016 11:35 AM, pcmantic...@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

Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Terry Reedy
On 5/10/2016 9:51 AM, Claudiu Popa wrote: Thank you for letting us know. While pylint is indeed opinionated in some cases, we're not trying to be "arrogant", as you put it, towards Guido or the other core developers. What's sad in this particular case is that the feedback had to come in rather

Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread pcmanticore
On Tuesday, May 10, 2016 at 5:58:37 PM UTC+3, Steven D'Aprano wrote: > Hi Claudiu, > > > On Tue, 10 May 2016 11:51 pm, Claudiu Popa wrote: > > > Thank you for letting us know. While pylint is indeed > > opinionated in some cases, we're not trying to be > > "arrogant", as you put it, towards

Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Steven D'Aprano
A further comment: On Tue, 10 May 2016 11:51 pm, Claudiu Popa wrote: > Thank you for letting us know. While pylint is indeed > opinionated in some cases, we're not trying to be > "arrogant", And from the docs: "What Pylint says is not to be taken as gospel and Pylint isn’t smarter than you

Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Steven D'Aprano
Hi Claudiu, On Tue, 10 May 2016 11:51 pm, Claudiu Popa wrote: > Thank you for letting us know. While pylint is indeed > opinionated in some cases, we're not trying to be > "arrogant", as you put it, towards Guido or the other core > developers. What's sad in this particular case is that the >

Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Claudiu Popa
On Sunday, May 8, 2016 at 4:41:02 AM UTC+3, Terry Reedy wrote: > On 5/7/2016 3:17 PM, Christopher Reimer wrote: > > > For my purposes, I'm using the list comprehension over filter to keep > > pylint happy. > > How sad. The pylint developers arrogantly take it on themselves to > revise Python,

Re: Pylint prefers list comprehension over filter...

2016-05-08 Thread Christopher Reimer
On 5/8/2016 5:02 AM, Steven D'Aprano wrote: On Sun, 8 May 2016 08:01 am, Christopher Reimer wrote: On 5/7/2016 2:22 PM, Chris Angelico wrote: Also, be sure you read this part of PEP 8: https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds

Re: Pylint prefers list comprehension over filter...

2016-05-08 Thread Steven D'Aprano
On Sun, 8 May 2016 08:01 am, Christopher Reimer wrote: > On 5/7/2016 2:22 PM, Chris Angelico wrote: >> Also, be sure you read this part of PEP 8: >> >> https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds > Recruiters and hiring managers *are*

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 6:40 PM, Terry Reedy wrote: On 5/7/2016 3:17 PM, Christopher Reimer wrote: For my purposes, I'm using the list comprehension over filter to keep pylint happy. How sad. The pylint developers arrogantly take it on themselves to revise Python, against the wishes of Guido and the

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Steven D'Aprano
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

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Terry Reedy
On 5/7/2016 3:17 PM, Christopher Reimer wrote: For my purposes, I'm using the list comprehension over filter to keep pylint happy. How sad. The pylint developers arrogantly take it on themselves to revise Python, against the wishes of Guido and the other core developers, and you and feel

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 1:31 PM, Marko Rauhamaa wrote: Christopher Reimer : Never know when an asshat hiring manager would reject my resume out of hand because my code fell short with pylint. Remember that it's not only the company checking you out but also you checking the

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Radek Holý
2016-05-07 21:17 GMT+02:00 Christopher Reimer : > 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,

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 2:22 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: 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

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 7:35 AM, Stephen Hansen wrote: > 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

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Stephen Hansen
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

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Nathan Hilterbrand
On 05/07/2016 05:22 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: pylint. Never know when an asshat hiring manager would reject my resume out of hand because my code fell short with pylint. I see that as a good

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 5:17 AM, 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

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Marko Rauhamaa
Christopher Reimer : > Never know when an asshat hiring manager would reject my resume out of > hand because my code fell short with pylint. Remember that it's not only the company checking you out but also you checking the company out. Would you want to work for

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
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

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/5/2016 7:57 PM, Stephen Hansen wrote: On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote: On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote: ''.join(x for x in string if x.isupper()) The difference is, both filter and your list comprehension *build a list* which is not

Re: Pylint prefers list comprehension over filter...

2016-05-06 Thread Steven D'Aprano
On Fri, 6 May 2016 12:57 pm, Stephen Hansen wrote: > On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote: >> On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote: >> >> > ''.join(x for x in string if x.isupper()) >> >> > The difference is, both filter and your list comprehension *build

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Chris Angelico
On Fri, May 6, 2016 at 1:07 PM, Dan Sommers wrote: > On Fri, 06 May 2016 02:46:22 +, Dan Sommers wrote: > >> Python 2.7.11+ (default, Apr 17 2016, 14:00:29) >> [GCC 5.3.1 20160409] on linux2 >> Type "help", "copyright", "credits" or "license" for more

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Dan Sommers
On Fri, 06 May 2016 02:46:22 +, Dan Sommers wrote: > Python 2.7.11+ (default, Apr 17 2016, 14:00:29) > [GCC 5.3.1 20160409] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> filter(lambda x:x+1, [1, 2, 3, 4]) > [1, 2, 3, 4] > >

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Stephen Hansen
On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote: > On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote: > > > ''.join(x for x in string if x.isupper()) > > > The difference is, both filter and your list comprehension *build a > > list* which is not needed, and wasteful. The above

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Chris Angelico
On Fri, May 6, 2016 at 12:46 PM, Dan Sommers wrote: > filter used to build a list, but now it doesn't (where "used to" means > Python 2.7 and "now" means Python 3.5; I'm too lazy to track down the > exact point(s) at which it changed): > > Python 2.7.11+ (default, Apr

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Dan Sommers
On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote: > ''.join(x for x in string if x.isupper()) > The difference is, both filter and your list comprehension *build a > list* which is not needed, and wasteful. The above skips building a > list, instead returning a generator ... filter

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Stephen Hansen
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. That said, the general consensus is, I believe,

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Chris Angelico
On Fri, May 6, 2016 at 11:26 AM, Christopher Reimer wrote: > Below is the code that I mentioned in an earlier thread. > > string = "Whiskey Tango Foxtrot" > ''.join(list(filter(str.isupper, string))) > > 'WTF' > > That works fine and dandy. Except Pylint

Pylint prefers list comprehension over filter...

2016-05-05 Thread Christopher Reimer
Greetings, Below is the code that I mentioned in an earlier thread. string = "Whiskey Tango Foxtrot" ''.join(list(filter(str.isupper, string))) 'WTF' That works fine and dandy. Except Pylint doesn't like it. According to this link, list comprehensions have replaced filters and