Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.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.077 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'lost.': 0.09; 'cc:addr :python-list': 0.11; 'def': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mean,': 0.16; 'subject:def': 0.16; 'wrote:': 0.18; 'replacing': 0.19; 'thu,': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'statement': 0.30; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; '"",': 0.31; 'implicit': 0.31; "can't": 0.35; 'received:google.com': 0.35; 'pm,': 0.38; '12,': 0.39; 'called': 0.40; 'ian': 0.60; 'name': 0.63; 'such': 0.63; 'more': 0.64; 'started.': 0.68; 'lack': 0.78; '2015': 0.84; 'subject:Alternative': 0.84; 'to:none': 0.92 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:cc :content-type; bh=Ue5dB1Xsqnw4HtCLXlLYs5jd9lGlC3hAfM5e2HasDzE=; b=sEv88U7/6iqnOrx2azFbEDnzvilGDbZcMAjUq++uESsj12mNNvJ6m6mu20Ujh9S+5T OXWITXO3aRo27GjzF/vSb4El8pJagxN/eMpOucJgym0slouDySDy+OzSQDT1SQWje3BL r4dGcujxvEt1EfsRb5sB+vlXftKiRUkfHNdj80D7jXJzOeg5wuWQdQt0Vd7si0gTr5Bq yufOACHQY18aooaFATPy+rO3nDaP7ZwKrKjY1uXObwM8VFsa4onYlv9tX9PBpn8M6fmc 3xMJxOrdwPcBmn5MgNM2E0ijqnH1+bbcI0D8Ipu38NWhRJyk8TRRgjUqwVmC+SWnPAt8 sMkg== MIME-Version: 1.0 X-Received: by 10.42.52.200 with SMTP id k8mr6580787icg.26.1423713372652; Wed, 11 Feb 2015 19:56:12 -0800 (PST) In-Reply-To: References: <54C3EAD1.2010501@stoneleaf.us> <54db5356$0$3915$e4fe514c@dreader34.news.xs4all.nl> Date: Thu, 12 Feb 2015 14:56:12 +1100 Subject: Re: Alternative to multi-line lambdas: Assign-anywhere def statements From: Chris Angelico Cc: Python Content-Type: text/plain; charset=UTF-8 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423713376 news.xs4all.nl 2837 [2001:888:2000:d::a6]:41342 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3848 X-Received-Body-CRC: 3387326176 Xref: csiph.com comp.lang.python:85565 On Thu, Feb 12, 2015 at 1:57 PM, Ian Kelly wrote: > The reason I don't like this replacing def isn't because the name is > necessarily lost. It's because the lack of the well-defined def > statement encourages more complex usages like > > functions['f'] = x -> x**2 > > where such implicit transformations won't work. That's actually where this started. I mean, if a function can be called "", why can't it be called "functions['f']"? ChrisA