nyoka <(E-Mail Removed)> writes:

> Can someone help me with sample python code for a code generator
Sure, here are some example of self-evaluating python objects, i.e. for each v

below,

v == eval(v)

I'm quite proud of the last one.

v = (lambda x

%('"''""'+x+'"''""'))("""(lambda x

%%('"''""'+x+'"''""'))(%s)""")

v = (lambda x

%('r\"'+x+'\"'))(r"(lambda x

%%('r\"'+x+'\"'))(%s)")

v = (lambda x

%`x`)('(lambda x

%%`x`)(%s)')

v = (lambda x: x+"("+`x`+")")('(lambda x: x+"("+`x`+")")')

v = "\"%s\" %% ((r\"%s\",)*2)" % ((r"\"%s\" %% ((r\"%s\",)*2)",)*2)

--

Arnaud