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


Groups > comp.lang.python > #80930

Re: Using map()

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Using map()
Date 2014-11-16 18:22 -0500
References <3b3e245f-c377-4543-b9eb-186e5087103a@lists.xtsubasa.org>
Newsgroups comp.lang.python
Message-ID <mailman.15922.1416180154.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 11/16/2014 8:01 AM, Pavel Volkov wrote:
> I checked my modules with pylint and saw the following warning:
>
> W: 25,29: Used builtin function 'map' (bad-builtin)
>
> Why is the use of map() discouraged?
> It' such a useful thing.

I consider that to be a bug in pylint.  It misstates a careless 'bad' 
opinion as a fact.

If pylint sees 'map(lambda ...: ', it would be appropriate to suggest 
using a comprehension or generator expression instead.  This avoids the 
unneeded creation and repeated call of a new function.  If it sees 
'map(<identifier>,', I think it should say nothing.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Using map() Terry Reedy <tjreedy@udel.edu> - 2014-11-16 18:22 -0500

csiph-web