Arnaud Delobelle
1/28/2008 12:08:00 AM
On Jan 27, 4:14 pm, Arnaud Delobelle <arno...@googlemail.com> wrote:
[...]
> 1. Starting from the classic idea (lambda x:x%x)('lambda x:x%x') I got
> the following
> v=(lambda x:x%('"''""'+x+'"''""'))("""(lambda x:x%%('"''""'+x+'"''""'))
> (%s)""")
A bit more readable:
v1=(lambda x:x%('r\"'+x+'\"'))(r"(lambda x:x%%('r\"'+x+'\"'))(%s)")
To Dan and Boris, this is cheating:-) I particularly like Boris's
"solution", it bends the rule very nicely! Although you should get a
NameError, not a SyntaxError for python < 3.0.
--
Arnaud