Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'resulting': 0.04; 'expressions': 0.07; 'string': 0.09; '22,': 0.09; 'feature.': 0.09; 'handful': 0.09; 'operand': 0.09; 'subject:Why': 0.09; 'cc:addr:python-list': 0.11; 'agree.': 0.16; 'expressions.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'literals': 0.16; 'python;': 0.16; 'semantics': 0.16; 'subject: \n ': 0.16; 'subject:comment': 0.16; 'subject:quoted': 0.16; 'subject:simple': 0.16; 'subject:triple': 0.16; 'syntax,': 0.16; 'wished': 0.16; 'wrote:': 0.18; 'programming': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; 'implicit': 0.31; 'languages': 0.32; 'url:python': 0.33; 'becomes': 0.33; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'pm,': 0.38; 'space': 0.40; 'expression': 0.60; 'url:3': 0.61; 'thomas': 0.65; 'subject:. ': 0.67; 'between': 0.67; 'mar': 0.68; '2015': 0.84; 'rexx,': 0.84; 'url:reference': 0.84; 'absolutely': 0.87; '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=6quszS1sQtZ7QAo/l16vbpfnJrIayrKYw6QFbU8WGwE=; b=VCQg0k6/wJkcYUJ2F8jvlqveoEW/KH10cCNVA0cyGPdJVC8f7uZN6tRynF2ypLQWDm 08XtjYV4/nitYKALoOzXBiYScY5eh1wJIrktEslfy3vFcOKQlptdv64i5nP2Dcc6lAgm VPV29eua5lr5RIYbTZiV4z7M92JUTnTz5AsTEqym69Ahs6/P1iTzKZg25+rbEejzwfNs 3+dxB8HfG8O1HC1DiBhof4lTQ7jWSaYmkLLNKLAAooRfxfUCu7htbSaidem1PlvPquc3 Jm5YwLJB3/E6VW+JlZ3imKqFP5bX87q6pK9r2bd3sWPWcUvneir8g1+XIwmBypCZOSN/ Fh/Q== MIME-Version: 1.0 X-Received: by 10.42.238.140 with SMTP id ks12mr12743281icb.12.1426995408848; Sat, 21 Mar 2015 20:36:48 -0700 (PDT) In-Reply-To: <3533816.ZYnZ2OzjCs@PointedEars.de> References: <3533816.ZYnZ2OzjCs@PointedEars.de> Date: Sun, 22 Mar 2015 14:36:48 +1100 Subject: Re: A simple single line, triple-quoted comment is giving syntax error. Why? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426995416 news.xs4all.nl 2909 [2001:888:2000:d::a6]:33886 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87811 On Sun, Mar 22, 2015 at 2:14 PM, Thomas 'PointedEars' Lahn wrote: > Denis McMahon wrote: > >> However, you can't have multiple expressions on a line without some sort >> of operand or separator between them. > > String concatenation is implicit in Python, but only with string *literals*: Which aren't expressions. Implicit concatenation is part of the syntax, not part of the expression evaluator. https://docs.python.org/2/reference/lexical_analysis.html#string-literal-concatenation https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation > (I wished other programming languages had this feature.) But I absolutely agree. A handful do (Pike, with the same semantics as Python; REXX, but with the proviso that any amount of whitespace between the literals becomes a single space in the resulting string), and it really is a very handy feature. ChrisA