4 ms·
"I'd love to hear why you think it's not ideal." I'm not the poster you posed that question to. But for me, the one big drawback of using that idiom is that th
by zo1 12y ago
"I'd love to hear why you think it's not ideal."
I'm not the poster you posed that question to. But for me, the one big drawback of using that idiom is that the function signatures have to be identical. So you either have to resort to args/kwargs, or you have an additional intermediary method between the actual "guts" of what you're calling, and the "switch" statement.
Or you live with the fact that you're passing unused/unnecessary parameters to your functions.
- myg204 12y agoGood point, and in that case, I would say this idiom is not so great really. For functions with the same signature, it's a fine solution I think.