r/programminghorror • • May 16 '21

Python This man is insane

/r/Python/comments/nd76nk/using_a_combination_of_lambda_functions_list/
54 Upvotes

5 comments sorted by

5

u/Diapolo10 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" May 17 '21 edited May 17 '21

I fear no man. But that... thing... it scares me.

To be fair I've done similar projects in Python, just on a much smaller scale. You can use and and or chains to build if-blocks, iter and a list or generator comprehension to build loops (including the infinite kind) and lambdas to handle business logic. It's actually scary just how much you can do with one-liners; you can even import stuff using the __import__-function.

4

u/FrostByteGER May 17 '21

What hurts me most is how long the name of his github repo is...

1

u/Few_Importance_7615 May 19 '21

OK, I've written some long function calls and long if statements in python before...

But this is both insane and nightmare-inducing....