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


Groups > comp.lang.python > #105403

Re: Convert list to another form but providing same information

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Convert list to another form but providing same information
Date Mon, 21 Mar 2016 14:14:23 -0600
Lines 8
Message-ID <mailman.462.1458591310.12893.python-list@python.org> (permalink)
References <1010f2cb-21f9-495b-8af4-03ad209b4c1e@googlegroups.com> <87bn67oayt.fsf@bsb.me.uk> <CALwzid=f5cQJyqij3hF_BoXdwkK4BuSj4YdTu3NbRnyUdYyRMg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de VIbM38WchXYkMMoQOIjd5QmVmDuiHim6yEyJ07fDxWZQ==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; '21,': 0.07; 'subject:form': 0.07; '(actually': 0.09; 'subject:same': 0.09; '2016': 0.16; 'lambda': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Convert': 0.16; 'url:faq': 0.16; 'wrote:': 0.16; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'subject:list': 0.26; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; "can't": 0.32; 'statement': 0.32; 'url:python': 0.33; 'received:google.com': 0.35; 'url:org': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'wanted': 0.37; 'received:209': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'url:3': 0.60; 'here:': 0.63; 'mar': 0.65; 'experts': 0.70; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=IwY+w9HPCiCTEi4BfM4AtUC0i+tPjHd2FCixTdC0Mmc=; b=FHoU23K8FVAS3B04PoT/aPLOrkU4MjcWUIYRj0bIG7aubbd0VLcNTcL0IAw+ZX+3o0 LRsT1ekr6gcR8BRkcKSVWpaS/O3wAkJ8UcSC0RAKWulOLwHZrCUVTTJlEIby8u/OsCb6 XT7rma/5Wx5VRX98agM9OO+N9hBjSZBsrx4koq27CliYIlu7VcbVYKOHp4LQlnzChpwR 7WJI69OA5a27fKGEMru7JAMbc1XFHGoj5XGuEQoOIMdW8qztRe8JEwlptRxMJ8wnMkS+ jk+8f9rFd225SBWWgUhO0P6Q2PLBzLQhV7HVMOnSuQrd+Fz75Zc4P+3aBHcoxTMNWmFw QAVQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=IwY+w9HPCiCTEi4BfM4AtUC0i+tPjHd2FCixTdC0Mmc=; b=KBr7UQMJeHIGNjVFCfCFvpqmOCN7UPQ199esM1jXBl+q0C0R5s04dTo4Vn230y7S2Q w+iThIHuq0BZ2YU7QnZYSiXjuLpSDFyi7nNKtrv+yD8EWgNxlsi7mzhmTlpor2o6FD25 Pb0PbdrMp+b/x/Kkk3kBrEW/A6n6AUfKPY461bCJ1jXH5JUagACplL6EC46Xsq8/3CFC r/pNv0SKXcHhbzTn38f9XXUWBrIH6UGqrzMV9oZnQzoDJkQwtXmM4RDl9ZNxu2Wc1DGD rQUfBa0ghzkzopvwJFdXZjoJnd1BRbt54i4ln7Ne7v/RIRxGQdyn+GYtvTekHPmiRIWY co5A==
X-Gm-Message-State AD7BkJIknwqopRfSFe8vLyb4V4LgFKXpq0A/A6VD8TbvAg/grE2tj1sVBSzZ80pqA8C8224uMpRiOuZ4Y8GtXw==
X-Received by 10.50.72.107 with SMTP id c11mr14823335igv.85.1458591302460; Mon, 21 Mar 2016 13:15:02 -0700 (PDT)
In-Reply-To <CALwzid=f5cQJyqij3hF_BoXdwkK4BuSj4YdTu3NbRnyUdYyRMg@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
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>
Xref csiph.com comp.lang.python:105403

Show key headers only | View raw


On Mon, Mar 21, 2016 at 2:12 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>> For experts here: why can't I write a lambda that has a statement in it
>> (actually I wanted two: lambda l, i: l[i] += 1; return l)?
>
> https://docs.python.org/3/faq/design.html#why-can-t-lambda-expressions-contain-statements

tl;dr: If you want a function with a statement in it, use def, not lambda.

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


Thread

Convert list to another form but providing same information Maurice <mauricioliveiraguarda@gmail.com> - 2016-03-21 11:26 -0700
  Re: Convert list to another form but providing same information Maurice <mauricioliveiraguarda@gmail.com> - 2016-03-21 11:30 -0700
    Re: Convert list to another form but providing same information Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-21 19:24 +0000
    Re: Convert list to another form but providing same information anantguptadbl@gmail.com - 2016-03-22 07:23 -0700
  Re: Convert list to another form but providing same information Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-21 19:21 +0000
  Re: Convert list to another form but providing same information Peter Otten <__peter__@web.de> - 2016-03-21 20:22 +0100
  Re: Convert list to another form but providing same information Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-03-21 20:03 +0000
    Re: Convert list to another form but providing same information Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-21 14:12 -0600
      Re: Convert list to another form but providing same information Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-03-22 00:31 +0000
        Re: Convert list to another form but providing same information Chris Angelico <rosuav@gmail.com> - 2016-03-22 11:58 +1100
        Re: Convert list to another form but providing same information Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-22 15:34 +1100
    Re: Convert list to another form but providing same information Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-21 14:14 -0600
  Re: Convert list to another form but providing same information Steven D'Aprano <steve@pearwood.info> - 2016-03-22 11:13 +1100
  Re: Convert list to another form but providing same information Paul Rubin <no.email@nospam.invalid> - 2016-03-21 18:35 -0700
    Re: Convert list to another form but providing same information Steven D'Aprano <steve@pearwood.info> - 2016-03-22 21:49 +1100

csiph-web