Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.musoftware.de!wum.musoftware.de!news.mind.de!news.cs.uni-magdeburg.de!news.uni-stuttgart.de!news.stw-bonn.de!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:bug': 0.04; 'interpreter': 0.05; 'mode,': 0.07; 'received:verizon.net': 0.07; 'terry': 0.07; "'this": 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:string': 0.09; 'literal,': 0.16; 'literals': 0.16; 'mode.': 0.16; 'reedy': 0.16; 'span': 0.16; 'subject:handling': 0.16; 'syntax': 0.16; 'wrote:': 0.18; 'errors,': 0.18; 'jan': 0.19; 'have,': 0.21; 'header:In-Reply- To:1': 0.22; 'wonder': 0.23; 'accidentally': 0.23; 'topic.': 0.23; 'works.': 0.23; 'string': 0.24; 'coding': 0.28; 'error': 0.29; 'pm,': 0.29; 'lines': 0.30; 'fairly': 0.30; 'does': 0.32; 'people,': 0.32; 'header:User-Agent:1': 0.33; 'header:X -Complaints-To:1': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'question,': 0.34; 'too': 0.34; 'subject:work': 0.34; 'something': 0.35; 'subject:with': 0.36; 'later,': 0.37; 'but': 0.37; 'technical': 0.37; 'received:org': 0.38; 'easier': 0.38; 'fail': 0.39; 'johnson': 0.39; 'why': 0.39; 'subject: (': 0.40; 'or,': 0.40; 'to:addr:python.org': 0.40; 'type': 0.61; 'subject:Possible': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Possible bug in string handling (with kludgy work-around) Date: Tue, 27 Dec 2011 16:38:58 -0500 References: <4ef91afb$0$29973$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325021956 news.xs4all.nl 6938 [2001:888:2000:d::a6]:48491 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18060 On 12/27/2011 1:04 PM, Rick Johnson wrote: > But this brings up a very important topic. Why do we even need triple > quote string literals to span multiple lines? Good question, and one i > have never really mused on until now. I have, and the reason I thought of is that people, including me, too ofter forget or accidentally fail to properly close a string literal, and type something like 'this is a fairly long single line string" and wonder why they get a syntax error lines later, or, in interactive mode, why the interpreter does not respond to a newline. Color coding editors make it easier to catch such errors, but they were less common in 1991. And there is still uncolored interactive mode. There may also be a technical reason as to how the lexer works. -- Terry Jan Reedy