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


Groups > comp.lang.python > #76723

Re: proposed syntax for multiline anony-functions (hopefully?)

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'syntax': 0.04; '21,': 0.07; 'error:': 0.07; '"("': 0.09; '"no"': 0.09; 'statements': 0.09; 'cc:addr:python-list': 0.11; '")"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'readable': 0.16; 'subject:?)': 0.16; 'syntax,': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'thoughts': 0.19; 'thu,': 0.19; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'question': 0.24; 'cc:2**0': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'subject: (': 0.35; 'anywhere': 0.35; 'point.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'clear': 0.37; 'pm,': 0.38; 'previous': 0.38; 'how': 0.40; 'truly': 0.60; 'new': 0.61; 'simply': 0.61; 'stand': 0.64; 'more': 0.64; 'side': 0.67; 'close': 0.67; 'glad': 0.83; 'alone.': 0.84; "it'd": 0.84; 'yours': 0.88; '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=s2do0knAyzpkBPBq0TvygDE1ceBd51DcxwlAEoITqHk=; b=vqKsyLeMCeqEgmextGJjc1JUc9avAKtPa78mU5yYR+KhTEc0hBeeYPqE/ebdeFUTLF vzKrGrGZpn1bixleyEd+URhWCeP5Ht6PcqLnvdeLdOgM3nzgmyvl52VfQzKr3yt8ewf2 jVD6iaNUm/H8BnOLVkdaYFYBsK+x+C1CjLoG1nqLPU4oX5G1Hz4MnOXBu0vWbCeaLrgP BEIVak0eNtJw64prA1wryMAEFzpw+rI+nVEJkxAVjWXxEoZNUfOI51ooq27fCx62y0hD hR350MyObBR33k//fbs7VRccWpUcgv1c0NDLNMKUO5NxEH3VFMR6goWfv6lfnJMF0KpX t49Q==
MIME-Version 1.0
X-Received by 10.43.46.133 with SMTP id uo5mr615489icb.71.1408611920159; Thu, 21 Aug 2014 02:05:20 -0700 (PDT)
In-Reply-To <93e3fb85-9e3b-4d3d-bed3-312172d55a4f@googlegroups.com>
References <1bd05b41-ad00-4ce8-8678-de51205ebc3b@googlegroups.com> <mailman.13240.1408609103.18130.python-list@python.org> <93e3fb85-9e3b-4d3d-bed3-312172d55a4f@googlegroups.com>
Date Thu, 21 Aug 2014 19:05:20 +1000
Subject Re: proposed syntax for multiline anony-functions (hopefully?)
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
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 <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.13244.1408611928.18130.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408611928 news.xs4all.nl 2917 [2001:888:2000:d::a6]:42901
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76723

Show key headers only | View raw


On Thu, Aug 21, 2014 at 6:59 PM,  <icefapper@gmail.com> wrote:
> thanks, bu what exactly do you find unlikeable in this syntax? the ")" is no new syntax, but simply a match for a previous "("; and you can put it anywhere because the "(" contents are space-insensitive:
>
> this would be a syntax error:
> a = def():
>    print("gvr")
>
> this too:
> a = def():
>   print("anon")
>
> but not this:
> a = (def():
>    print("no")
> )
>
> neither this:
> a = (def():
>    print("d"))
>
> nor this:
> a = (def():
>     print( "no" )
>
>
> )
>
> yours truly would be glad to know your thoughts on this

I think it's less readable if the close parens goes on the previous
line. However, that's a question of style, more than syntax. I just
think it'd look better with a clear unindent at the end of a block of
statements which all stand alone.

But that was a small side point. What matters is: How is this new
syntax better than out-of-line function definition?

ChrisA

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


Thread

proposed syntax for multiline anony-functions (hopefully?) icefapper@gmail.com - 2014-08-21 00:55 -0700
  Re: proposed syntax for multiline anony-functions (hopefully?) Chris Angelico <rosuav@gmail.com> - 2014-08-21 18:18 +1000
    Re: proposed syntax for multiline anony-functions (hopefully?) icefapper@gmail.com - 2014-08-21 01:59 -0700
      Re: proposed syntax for multiline anony-functions (hopefully?) Chris Angelico <rosuav@gmail.com> - 2014-08-21 19:05 +1000
    Re: proposed syntax for multiline anony-functions (hopefully?) icefapper@gmail.com - 2014-08-21 02:06 -0700
    Re: proposed syntax for multiline anony-functions (hopefully?) icefapper@gmail.com - 2014-08-21 02:27 -0700
  Re: proposed syntax for multiline anony-functions (hopefully?) icefapper@gmail.com - 2014-08-21 02:14 -0700
    Re: proposed syntax for multiline anony-functions (hopefully?) Marko Rauhamaa <marko@pacujo.net> - 2014-08-21 12:27 +0300
      Re: proposed syntax for multiline anony-functions (hopefully?) icefapper@gmail.com - 2014-08-21 02:30 -0700
        Re: proposed syntax for multiline anony-functions (hopefully?) alex23 <wuwei23@gmail.com> - 2014-08-22 15:15 +1000
    Re: proposed syntax for multiline anony-functions (hopefully?) Terry Reedy <tjreedy@udel.edu> - 2014-08-21 06:07 -0400
  Re: proposed syntax for multiline anony-functions (hopefully?) Travis Griggs <travisgriggs@gmail.com> - 2014-08-22 13:05 -0700
    Re: proposed syntax for multiline anony-functions (hopefully?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-23 19:20 +1000
  Re: proposed syntax for multiline anony-functions (hopefully?) Dan Stromberg <drsalists@gmail.com> - 2014-08-22 16:48 -0700
  Re: proposed syntax for multiline anony-functions (hopefully?) Dan Stromberg <drsalists@gmail.com> - 2014-08-22 16:58 -0700
    Re: proposed syntax for multiline anony-functions (hopefully?) Marko Rauhamaa <marko@pacujo.net> - 2014-08-23 10:37 +0300

csiph-web