Pylint prefers list comprehension over filter...

Terry Reedy tjreedy at udel.edu
Tue May 10 15:47:07 EDT 2016


On 5/10/2016 11:35 AM, pcmanticore at 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 <argument expression>"

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




More information about the Python-list mailing list