Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'string.': 0.05; 'wednesday,': 0.07; 'string': 0.09; 'here?': 0.09; 'subject:Why': 0.09; 'python': 0.11; "'''": 0.16; 'bhatt': 0.16; 'subject: \n ': 0.16; 'subject:comment': 0.16; 'subject:quoted': 0.16; 'subject:simple': 0.16; 'subject:triple': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'to:name:python-list@python.org': 0.22; 'string,': 0.24; 'sort': 0.25; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'testing': 0.29; '(like': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'comments': 0.31; 'url:python': 0.33; 'comment': 0.34; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'subject:?': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'thank': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'expression': 0.60; 'march': 0.61; 'you.': 0.62; 'provide': 0.64; 'here': 0.66; 'subject:. ': 0.67; 'mar': 0.68; 'invalid': 0.68; '2015': 0.84; 'response,': 0.91 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:to :content-type; bh=EpLTN4bM4JpB2CDNq6qjQ9a25ciXWaQoiO9QGDFu2/8=; b=AuxrWXMDKBay7s+lzxDU/26lRlxOlTh1mWR/PbMZ/fajZoJ1BWL2UZs7zqIr3ujKkn Lxw3ZlcsnGiwizqy6YziuTMuAnktB/I1Z7HrimL9gJ0hjM9aQhGJbtlB3/u+YfacIBDt 7JxjDtbj+V4NwT9/h9yV3XSAEV8TfOd1As6yC4SgZJm9S7ONfjgeGVmk883MTNtErY1s HB0HBmwekSa+TnewRs9zLf83gptSfzOIlQ4kk2kBsUSA4Gi1YOyb+JJyrer44bRKP9wT bYMCTio+L8figafJ/ZNhYlTbj5hFPKSo8kti6/t2RuM4OP+d6CHKns0ZukMwbwKUi6Nt IVGA== MIME-Version: 1.0 X-Received: by 10.194.120.230 with SMTP id lf6mr142874884wjb.78.1426704312991; Wed, 18 Mar 2015 11:45:12 -0700 (PDT) In-Reply-To: <8908fd12-9069-4230-8b1c-3f88e74bdabf@googlegroups.com> References: <5509be2c$0$3027$426a74cc@news.free.fr> <8908fd12-9069-4230-8b1c-3f88e74bdabf@googlegroups.com> Date: Wed, 18 Mar 2015 14:45:12 -0400 Subject: Re: A simple single line, triple-quoted comment is giving syntax error. Why? From: Igor Korot To: "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: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426704320 news.xs4all.nl 2915 [2001:888:2000:d::a6]:44693 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87693 Hi, On Wed, Mar 18, 2015 at 2:23 PM, Aditya Raj Bhatt wrote: > On Wednesday, March 18, 2015 at 1:04:39 PM UTC-5, Laurent Pointal wrote: >> > Can someone also provide a sort of a 'guide' to triple-quoted > comments >> > in general? >> >> A triple ' or " string is a Python string, allowing line-return in > string. > > What do you mean by line-return in string? Is it newline? Does it mean I > can write - > > '''first part > second part''' > > ? > >> If it is in an expression (like a = 5 '''a comment'''), then it must > be a >> valid expression (and here it is not). > > What is not a valid expression here? a = 5 #Valid expression b = c + d # Valid expression a = 5 b = c + d # Invalid expression a = 5 # Valid expression ''' testing comment ''' # Valid expression a = 5 ''' testing comment ''' #Invalid expression Thank you. > >> >> A+ >> Laurent. > > Thank you for the fast and detailed response, > Aditya > -- > https://mail.python.org/mailman/listinfo/python-list