Migrating to perl?

Fredrik Lundh fredrik at effbot.org
Sat Jan 6 15:36:56 EST 2001


Tom Bryan wrote:
> That's funny.  Although there *is* more than one way to do this in Python,
> Python users don't seem to care for exercises in finding and displaying
> "neat tricks" in Python.

people used to, but then Greg Stein posted this little obfuscated
one-liner masterpiece:

http://www.egroups.com/message/python-list/44950

"Try this on for size. Cut and paste it into an interpreter,
all on one line (if you can't cut and paste, then don't try!).

f=lambda
x=['31312405171810171211313126112','7189749374747628707','9626701','88738091
95908988937382747529513','807979748182306979652922711','25141421122626106','
hi there!'],z=globals(),y=lambda x: reduce(lambda x,y:x+y,map(lambda
x,y=x,z=lambda
x:int(x[:2]):chr((z(y[x*int(y[-5]):])^z(y[-4:]))+z(y[-4:])),range(int(x[-2:]
)))):map(lambda
z,x=y,y=x,w=z:z(z(w[x(y[2])],x(y[3]))[0],x(y[5]))(x(y[4])),[vars(z[y(x[0])])
[y(x[1])]]) and x[-1];print f()

:::

an annotated version can be found here:
http://www.egroups.com/message/python-list/44958

cheers /F





More information about the Python-list mailing list