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

Jeff Epler jepler at unpythonic.net
Mon Oct 4 17:48:28 CEST 2004


On Mon, Oct 04, 2004 at 03:07:17PM +0000, exarkun at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20041004/20df2a99/attachment.pgp>


More information about the Python-list mailing list