Re: Mandis Quotes (aka retiring """ and ''')

From: Jeff Epler (jepler_at_unpythonic.net)
Date: 10/04/04


Date: Mon, 4 Oct 2004 10:48:28 -0500
To: exarkun@divmod.com


On Mon, Oct 04, 2004 at 03:07:17PM +0000, exarkun@divmod.com wrote:
> Responding to "replacing them by a single 'x' that suffices for everything":
> No, it doesn't.
> It replaces them with an arbitrary number of string delimiters. 'x'
> is one, but 'y' is another, 'Would you like some spam?' is yet
> another. You must still be careful in selecting your delimiter,
> lest you accidentally use one included in your string literal. The
> chances of doing so are greatly decreased, but they are still
> non-zero.
> The idea doesn't seem all bad, but it doesn't seem like a great
> enough improvement to justify very nearly breaking every Python
> program ever written in dozens, hundreds, or even thousands of
> different places.
> Jp

Ouch. You're right. Here's another program whose meaning changes
radically with mandis-quotes:

    print '-' * 72
    do_the_real_work()
    print '-' * 72

Any program that contains the same double-quoted string twice would change
meaning under this proposal.

On the other hand, does this program have any meaning left?
    print 'x'
it must be an unterminated mandis-quoted string.

OK, shoot this proposal right now.

Jeff






Relevant Pages

  • Another parser question
    ... For convenient handling of config files a functionality like the tcl string parsing considering the braces (or any other string delimiters with start and end meaning and "normal" quotes) would be great, and also nested strings should be handled. ...
    (comp.lang.tcl)
  • Is a bugfix version of jeds pymode.sl editor config file available anywhere?
    ... I just started using the jed editor, and am really happy with it-- ... However, my python mode ... it doesn't understand that '''This 'string' isn't really a string''' ... ' marks as string delimiters as well as treating the ...
    (comp.lang.python)
  • Re: 80004005 Unspecified Error
    ... The data value for this portion of the VALUESlist should not be ... enclosed in string delimiters. ... Prev by Date: ...
    (microsoft.public.inetserver.asp.db)
  • Re: Numbers of tiles in the Himly and Glover sets.
    ... The fact such word with its full meaning as a string of coins did not ... YOU also said "I have no evidence of its use." ... Have you attempted to research whether suo3 had any other meanings/ ...
    (rec.games.mahjong)
  • Re: Numbers of tiles in the Himly and Glover sets.
    ... The fact such word with its full meaning as a string of coins did not ... YOU also said “I have no evidence of its use.” ... Have you attempted to research whether suo3 had any other meanings/ ...
    (rec.games.mahjong)