Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'lines.': 0.05; 'subject:Python': 0.06; 'continuation': 0.07; 'rules.': 0.07; 'suggesting': 0.07; 'python': 0.08; 'case)': 0.09; 'operator,': 0.09; 'subject:] ': 0.14; 'subsequent': 0.15; '*after*': 0.16; 'incomplete': 0.16; 'indent': 0.16; 'parentheses': 0.16; 'unambiguous': 0.16; 'cc:addr:python-list': 0.16; 'syntax': 0.16; 'wrote:': 0.16; 'cc:no real name:2**0': 0.20; 'header:In-Reply-To:1': 0.22; 'received:209.85.212.46': 0.23; 'received:mail-vw0-f46.google.com': 0.23; 'appear': 0.23; 'breaks': 0.23; 'indentation': 0.23; 'pm,': 0.24; 'aug': 0.24; 'bruce': 0.24; 'code': 0.25; 'statement': 0.25; "i'm": 0.27; '(this': 0.28; 'thu,': 0.28; 'message-id:@mail.gmail.com': 0.29; '---': 0.29; 'cc:addr:python.org': 0.30; 'lines': 0.30; '(so': 0.30; 'line:': 0.30; '\xc2\xa0\xc2\xa0\xc2\xa0': 0.30; 'error': 0.32; 'cases': 0.32; 'this.': 0.32; 'actual': 0.32; 'break': 0.32; 'does': 0.32; 'comment': 0.32; 'regardless': 0.34; 'done': 0.34; 'received:209.85.212': 0.34; 'clearly': 0.34; 'rather': 0.35; 'doing': 0.36; 'example,': 0.37; 'using': 0.37; 'but': 0.37; 'could': 0.38; 'think': 0.38; 'cc:2**2': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'unlike': 0.39; 'enough': 0.39; "i'd": 0.40; 'third': 0.40; "it's": 0.40; 'order': 0.62; 'comments,': 0.64; 'due': 0.66; '11,': 0.68; '8bit%:100': 0.70; 'today': 0.71; 'anything,': 0.73; 'subject:line': 0.73; 'blank': 0.74; 'skip:\xc2 10': 0.74; '12:24': 0.84; 'ambiguous.': 0.84; 'want:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=lkZtxSvdPssslh5C959kpPPvRhlP2PdlmBFkEemr2rM=; b=cyWUki4TqUGUBNS5aiSfW9QAq54clekZ7scrqoX0oxWPXLNFWm393P3d98JGECqRZr MTP8hrsQ9SGJxw81GDVO1d81MRTV8trQKxy6Q7ArdAwDEmv95sTP8vpIkK2Y9I7hbmjB 3b/nA4LXgxiSftkthk8BcFONCwIgrSaDhm5EM= MIME-Version: 1.0 In-Reply-To: References: <1312951356.77394.YahooMailNeo@web121518.mail.ne1.yahoo.com> <4e424208$0$29965$c3e8da3$5496439d@news.astraweb.com> <1312981104.89312.YahooMailNeo@web121520.mail.ne1.yahoo.com> <1312982377.95657.YahooMailNeo@web121508.mail.ne1.yahoo.com> <1313031175.38817.YahooMailNeo@web121515.mail.ne1.yahoo.com> <4E43D2F2.1090004@mrabarnett.plus.com> From: Devin Jeanpierre Date: Thu, 11 Aug 2011 17:06:59 -0400 Subject: Re: [Python-ideas] allow line break at operators To: Bruce Leban Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org, Paul Colomiets , python-ideas X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 59 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313096861 news.xs4all.nl 23949 [2001:888:2000:d::a6]:58407 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11227 > Right now you do not need to indent continuation lines. So in order to di= sambiguate you would need to enforce indentation for continuations, but for= backward compatibility that would only be required when not using parenthe= ses or backslashes. Ick. Can blank lines or comment lines appear between a = line and its continuation? That's allowed now as well. Eek no. If I was suggesting anything, it would have been a third form of continuation: collapsing subsequent extra-indented lines. This is never ambiguous. (This could be done in such a way as to permit comments, namely, by doing it to the tokenstream rather than to the actual text) Devin On Thu, Aug 11, 2011 at 4:45 PM, Bruce Leban wrote: > > On Thu, Aug 11, 2011 at 12:24 PM, Devin Jeanpierre wrote: >> >> Javascript also lets you break lines. For example, this does what you wa= nt: >> >> =C2=A0=C2=A0=C2=A0 return 1 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 + 5 >> >> Whereas this does not >> >> =C2=A0=C2=A0=C2=A0 return >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 + 5 >> >> Of course, Python would have no such problem, because you could make bot= h cases unambiguous due to the indent. >> >> Devin >> > Note that this is already valid and is not a continuation line: > > return 1 > +5 > > Right now you do not need to indent continuation lines. So in order to di= sambiguate you would need to enforce indentation for continuations, but for= backward compatibility that would only be required when not using parenthe= ses or backslashes. Ick. Can blank lines or comment lines appear between a = line and its continuation? That's allowed now as well. > Now allowing line breaks *after* operators would be unambiguous and would= not require new indentation rules. When a line ends with an operator, it's= clearly incomplete (so no fear the reader will think the statement has end= ed unlike the above case) and it's a syntax error today: > > return 1 + > =C2=A0 =C2=A0 5 > x =3D y > 0 and > =C2=A0 =C2=A0y < 10 > > This code is not valid today without parens or \ regardless of indentatio= n. I'm +0 on this. I'd use it but does it really add enough convenience? > --- Bruce > Follow me:=C2=A0http://www.twitter.com/Vroo=C2=A0http://www.vroospeak.com