3 ms·
If you're hardcoding it sure, but at that point you should consider just using a module with bare functions. This pattern is for when the lookup value comes fro
by Izkata 3y ago
If you're hardcoding it sure, but at that point you should consider just using a module with bare functions. This pattern is for when the lookup value comes from somewhere else, and to use it with attributes requires a more awkward getattr() call, and it has a less obvious error message if the value isn't in the lookup.