Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; '16,': 0.03; 'builtin': 0.09; 'pavel': 0.09; 'subject:()': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'bug': 0.12; 'cc:name:python list': 0.16; 'expression.': 0.16; 'fine.': 0.16; 'lisp,': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.18; 'example': 0.22; 'cc:addr:python.org': 0.22; '2.x': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message- id:@mail.gmail.com': 0.30; '3.x': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'checked': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'useful': 0.36; 'wrong': 0.37; 'list': 0.37; 'nov': 0.38; 'fact': 0.38; 'pm,': 0.38; 'rather': 0.38; 'bad': 0.39; 'such': 0.63; 'map': 0.64; 'believe': 0.68; 'attention': 0.75; 'saw': 0.77; 'subject:Using': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rl0Ojt/rXgxfe7+iihxir1f254dbtv20XO505xwsmuk=; b=PnnzHi4+GkfP39b9NHBKKXO5kfFAWFzWSYJPF7GDVevae1tlyk1sWk3TTLtOxmXsc3 g33oP0vMo0njENFwwKKlQJSG8xifoXrS9e/4YXBRxvdNqlKMPJbcYVJXCgX0lJ+fw6vH mZjRa6dUkG+NmrfryRHidPeifiF8Smcp/eiYgdHPXuSS2v9rqrWVenWonTxh64VgZfXZ Kk2UDvFKxeFui0PeuNXfHgGrI8vNWPbkcqrW3aExsoR86KbNmGyN6OmVQTcKh4Xk4mnz CY1MRb2wWG3x2c5Qx7nuXJ2fXOkHSg39Wyp8GSpBO/LXZdeMpJAiiyb+JdSNQHaNK0kE Nc7g== MIME-Version: 1.0 X-Received: by 10.112.201.72 with SMTP id jy8mr23769683lbc.65.1416187886402; Sun, 16 Nov 2014 17:31:26 -0800 (PST) In-Reply-To: <54693cc4$0$13000$c3e8da3$5496439d@news.astraweb.com> References: <54693cc4$0$13000$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 16 Nov 2014 17:31:26 -0800 Subject: Re: Using map() From: Dan Stromberg To: "Steven D'Aprano" Content-Type: text/plain; charset=UTF-8 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416187894 news.xs4all.nl 2856 [2001:888:2000:d::a6]:40124 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80945 On Sun, Nov 16, 2014 at 4:09 PM, Steven D'Aprano wrote: > 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. > > That's a bug in pylint. It's not a bad builtin, it is perfectly fine. > > Some people don't like map. Pay no attention to them. I actually avoid map. map works as intended; there's nothing particularly wrong with it. In fact I believe it's pretty important in lisp, but it's a rather glaring example of TMTOWTDI in Python. BTW, I believe in Python 2.x map is like a list comprehension, but in 3.x map is like a generator expression.