Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!lightspeed.eweka.nl!lightspeed.eweka.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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; 'operator': 0.03; 'received:209.85.223': 0.03; 'syntax': 0.04; 'subject:Python': 0.06; 'binary': 0.07; 'cc:addr:python-list': 0.11; 'def': 0.12; '"def"': 0.16; 'assignment.': 0.16; 'def.': 0.16; 'distinct': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'func': 0.16; 'lambda': 0.16; 'operators,': 0.16; 'ternary': 0.16; 'wrote:': 0.18; 'basically': 0.19; 'replacing': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'alternate': 0.24; 'visible': 0.24; 'cc:2**0': 0.24; 'van': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'too.': 0.31; 'object.': 0.31; 'probably': 0.32; 'actual': 0.34; 'maybe': 0.34; 'received:209.85': 0.35; 'anywhere': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done,': 0.36; 'doing': 0.36; 'two': 0.37; 'received:209': 0.37; 'being': 0.38; 'implement': 0.38; 'rather': 0.38; "you'll": 0.62; 'name': 0.63; 'subject:! ': 0.74; 'square': 0.74; '11:45': 0.84; '2015': 0.84; 'albert': 0.91; 'thoroughly': 0.91; '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:content-transfer-encoding; bh=kOHEnOgv1YFZSEiPp2u3Zd6q1NJgV8/ul5JeWeRoEC0=; b=DFCgNHIS20lX8PcEz1nyYy6hEEQ3bKLXMSTKQ/W/ToyNb7/WLuZE0Xkg9a9/uLpa3W YN5a+G1Tb40Sye54cqZa3Rze2RbxZr/iMmzcir1MeY5miMLzgm2rOmne96qyKxCGxqEm eb1HAAK+y6wStsX5Un8qoiU5UbCXnzyOYVvY1TwUwONXPoQZrtzFtfhW19qwPVkgK7dk Y+gyBMvFE0AyFt3+InyFFIljv+rZEluo4cxLdQiEHYsl46NbOTdppTGLuI0Uo2KKE2du xQg2Jq3zJ1B1y/9796hkLPmTPAKQl6KW6dPn3g3nijZ8IGiVCayV+vOHqae/ldDAav7M bqxw== MIME-Version: 1.0 X-Received: by 10.107.158.146 with SMTP id h140mr18451103ioe.27.1423357264675; Sat, 07 Feb 2015 17:01:04 -0800 (PST) In-Reply-To: <54d6b1a0$0$6917$e4fe514c@dreader36.news.xs4all.nl> References: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> <54d6b1a0$0$6917$e4fe514c@dreader36.news.xs4all.nl> Date: Sun, 8 Feb 2015 12:01:04 +1100 Subject: Re: Python is DOOMED! Again! From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423357272 news.xs4all.nl 2850 [2001:888:2000:d::a6]:57158 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4545 X-Received-Body-CRC: 1107756897 Xref: csiph.com comp.lang.python:85346 On Sun, Feb 8, 2015 at 11:45 AM, Albert van der Horst wrote: > def square(x): x**2 > but > square =3D x->x**2 > > or > > mult =3D x,y -> > result =3D 0 > for i in range(x): > result +=3Dy > return result > > doing away with the ternary operator def > > def .. ( .. ) : .. > > replacing it by two binary operators, one of them (=3D) being thoroughly = familiar. Thing is, "def" isn't just assignment. It also takes the name and stores it in the object. There's a distinct and visible difference between: def square(x): return x**2 and def func(x): return x**2 square =3D func So if you were to use your alternate syntax everywhere, you'd basically be throwing away all the benefits of def over lambda. Now, you may well be able to justify and implement an alternative for lambda that works this way. (And it's probably already been done, too. Maybe using the actual symbol =CE=BB rather than ->.) But I don't think you'll get anywhere with def. ChrisA