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

Max M maxm at mxm.dk
Tue Oct 5 09:35:36 EDT 2004


Ville Vainio wrote:
>>>>>>"gabriele" == gabriele renzi <rff_rff at remove-yahoo.it> writes:
> 
> 
>     gabriele> Russell Nelson ha scritto:
>     gabriele> I guess you could just use a shell like heredocument then:
>     gabriele> foo << marker
>     gabriele> string
>     gabriele> marker
> 
>     gabriele> why invent something new?
> 
> I'm speculating that this thread is an elaborate joke. I hope so at
> least.

Actually it is pretty interresting. Most likely it will not lead to 
anything usefull. But at least it will have been considdered.

This kind of quoting is not exactly new. It is allready used in 
multi-part MIME messages, where you define a boundary, that is a unique 
string and can look like so:

------_=_NextPart_001_01C4971F.E7E266DB

It makes it possible to send multiple binary files encoded as text, and 
still find the boundaries between them.

It is defined like this:

This is a multi-part message in MIME format.

Content-Type: multipart/alternative;
	boundary="----_=_NextPart_002_01C4971F.E7E266DB"


So being able to do the same in Python might have some value. At least 
you would be able to define all kind of strings the same way, and it's 
easy to understand.

But the 'delimiter' notation is a bit too clunky. Using ' and " is quite 
simple, and doesn't leave as much typographic noise.

If there was a smarter (shorter) notation, I think it would definitely 
be usefull.


-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science



More information about the Python-list mailing list