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


Groups > comp.lang.python > #80945

Re: Using map()

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 <drsalists@gmail.com>
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 <mailman.15896.1416169228.18130.python-list@python.org> <54693cc4$0$13000$c3e8da3$5496439d@news.astraweb.com>
Date Sun, 16 Nov 2014 17:31:26 -0800
Subject Re: Using map()
From Dan Stromberg <drsalists@gmail.com>
To "Steven D'Aprano" <steve+comp.lang.python@pearwood.info>
Content-Type text/plain; charset=UTF-8
Cc Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15934.1416187894.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Sun, Nov 16, 2014 at 4:09 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> 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.

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


Thread

Using map() Pavel Volkov <sailor@lists.xtsubasa.org> - 2014-11-16 16:01 +0300
  Re: Using map() Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-17 11:09 +1100
    Re: Using map() Ned Batchelder <ned@nedbatchelder.com> - 2014-11-16 19:24 -0500
    Re: Using map() Chris Angelico <rosuav@gmail.com> - 2014-11-17 12:08 +1100
    Messages from code analysis tools (was: Using map()) Ben Finney <ben+python@benfinney.id.au> - 2014-11-17 12:21 +1100
    Re: Using map() Dan Stromberg <drsalists@gmail.com> - 2014-11-16 17:31 -0800
    Re: Messages from code analysis tools (was: Using map()) Chris Angelico <rosuav@gmail.com> - 2014-11-17 12:36 +1100
    Re: Messages from code analysis tools Ned Batchelder <ned@nedbatchelder.com> - 2014-11-16 20:49 -0500

csiph-web