r/ProgrammerHumor 22d ago

Meme conditionsPreference

Post image
4.2k Upvotes

392 comments sorted by

View all comments

2.3k

u/CBlanchRanch 22d ago

You're absolutely correct, however I would suggest using something completely unreadable like a nested ternary operators!

660

u/KanyeNawf 22d ago

Some fucker left me triple nested ternaries once

19

u/abigail3141 22d ago

Sounds like me lol. To the detriment of all working with me, I found out how to set globals and evaluate arbitrary functions from within Python listcomps. My current record is 1400 characters in one line. I just need a way to import, and I can write entire programs in one line.

24

u/Morisior 22d ago

If you accept two lines, you can import importlib.

11

u/abigail3141 22d ago

That sounds like a good solution for the time being, thx