3 ms·
It can be idiomatic in certain circumstances. If your dict keys are just numbers, then no, probably not. But strings mapping to functions, and in some cases ob
by meowface 12y ago
It can be idiomatic in certain circumstances.
If your dict keys are just numbers, then no, probably not. But strings mapping to functions, and in some cases objects and other things, are often used to substitute for numerous if and elif statements.