On Jan 29, 3:48 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> | I found 
> this:http://groups.google.com/group/comp.lang.python/browse_thread/thread/...
>
> Exactly the one I meant.
>
> | It contains a lambda-solution similar to mine, only more concise:
>
> | (lambda x:x%`x`)('(lambda x:x%%`x`)(%s)')
>
> Being a Lisp novice, I was rather proud of that translation
>
> | I have been using python for 7 years, and it the first time ever that
> | I see the `...` construct being used!
>
> It is going away in 3.0, so the above would need revision to work with
> repr(), if indeed it will.

Here's the py3k-compliant version:

>>> k=(lambda x:x%repr(x))('(lambda x:x%%repr(x))(%s)')
>>> k == eval(k)
True

--
Arnaud
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to