[Python-Dev] "%%s %s"%"hi"%ho" works here and not there

Michael Hudson mwh@python.net
Mon, 16 Jun 2003 13:16:39 +0100


Hunter Peress <hfastjava@yahoo.com> writes:

> In irc, I gave this unusually compact line as an answer to a slightly related question:
> "%%s %s"%"hi"%ho" 
>

That line contains an odd number of double quotes and no escaping
characters.  How could it work?

>>> "%%s %s"%"hi"%"ho"
'ho hi'

is fine (% is left associative).

Cheers,
M.

-- 
  I also fondly recall Paris because that's where I learned to
  debug Zetalisp while drunk.                          -- Olin Shivers