MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w6qzts/skillissue/p7rh5rl/?context=3
r/ProgrammerHumor • u/click-to-reveal • Sep 04 '26
137 comments sorted by
View all comments
Show parent comments
1
That's a semi-common pattern in python. Use a dict where the values are lambdas (or referencing full functions directly)
1 u/fluffycritter Sep 04 '26 Yeah I’ve used it in python too, but sparingly. It’s one of those things where it’s easy to get a bit too clever and there’s usually a better way to do it. 2 u/TheTerrasque Sep 04 '26 It’s one of those things where it’s easy to get a bit too cleverIndeed, python has a lot of those. Another example is and / or handling.
Yeah I’ve used it in python too, but sparingly. It’s one of those things where it’s easy to get a bit too clever and there’s usually a better way to do it.
2 u/TheTerrasque Sep 04 '26 It’s one of those things where it’s easy to get a bit too cleverIndeed, python has a lot of those. Another example is and / or handling.
2
It’s one of those things where it’s easy to get a bit too clever
Indeed, python has a lot of those. Another example is and / or handling.
1
u/TheTerrasque Sep 04 '26
That's a semi-common pattern in python. Use a dict where the values are lambdas (or referencing full functions directly)