DEV Community

Discussion on: Are one liners always pythonic?

Collapse
 
qviper profile image
Viper

Lambda within a lambda. You deserve a medal.

Collapse
 
chrisgreening profile image
Chris Greening

lol can't claim the credit but definitely a bunch of clever tricks in there, here's another one-line Brainf*ck interpreter

Thread Thread
 
qviper profile image
Viper

Thanks for sharing. But oneliner is not that much readable. (I think)

Thread Thread
 
miguelmj profile image
MiguelMJ

That's true, but I guess for some they are like a challenge. It happens the same with esoteric languages... We could say that Python becomes an esoteric language when you apply the rule "all in one line" hahaha

Thread Thread
 
chrisgreening profile image
Chris Greening

Pretty recently I was writing a program that was going to be automated on a server with limited space so I crunched the program from 100 lines to like 15 awful one liners and it cut the size of the file down to like less than a kilobyte lol it was a fun challenge to see how small I could get the program and I could see people doing it for fun/proof of concept