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


Groups > comp.lang.python > #18059

Re: Possible bug in string handling (with kludgy work-around)

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Possible bug in string handling (with kludgy work-around)
Date 2011-12-27 16:38 -0500
References <mailman.4112.1324938867.27778.python-list@python.org> <4ef91afb$0$29973$c3e8da3$5496439d@news.astraweb.com> <mailman.4133.1324997611.27778.python-list@python.org> <cce5eb97-8e7f-48c6-8f0d-ec6442871196@k28g2000yqn.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.4155.1325021956.27778.python-list@python.org> (permalink)

Show all headers | View raw


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

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


Thread

Possible bug in string handling (with kludgy work-around) Charles Hixson <charleshixsn@earthlink.net> - 2011-12-26 14:23 -0800
  Re: Possible bug in string handling (with kludgy work-around) Rick Johnson <rantingrickjohnson@gmail.com> - 2011-12-26 14:48 -0800
    Re: Possible bug in string handling (with kludgy work-around) Chris Angelico <rosuav@gmail.com> - 2011-12-27 10:05 +1100
  Re: Possible bug in string handling (with kludgy work-around) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-27 01:10 +0000
    Re: Possible bug in string handling (with kludgy work-around) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-12-27 09:53 -0500
      Re: Possible bug in string handling (with kludgy work-around) Rick Johnson <rantingrickjohnson@gmail.com> - 2011-12-27 10:04 -0800
        Re: Possible bug in string handling (with kludgy work-around) Lie Ryan <lie.1296@gmail.com> - 2011-12-28 08:23 +1100
        Re: Possible bug in string handling (with kludgy work-around) Terry Reedy <tjreedy@udel.edu> - 2011-12-27 16:38 -0500
          Re: Possible bug in string handling (with kludgy work-around) Rick Johnson <rantingrickjohnson@gmail.com> - 2011-12-27 16:57 -0800
            Re: Possible bug in string handling (with kludgy work-around) Lie Ryan <lie.1296@gmail.com> - 2011-12-29 04:54 +1100
        Re: Possible bug in string handling (with kludgy work-around) Terry Reedy <tjreedy@udel.edu> - 2011-12-27 16:38 -0500

csiph-web