3 ms·
Who.....codes like this? Use a method dispatch instead, and have the dispatcher worry about throwing the exception: try: DispatchController.dispatc
by deaddodo 8y ago
Who.....codes like this? Use a method dispatch instead, and have the dispatcher worry about throwing the exception:
try:
DispatchController.dispatch()
except:
raise DispatchFailed()
And/or use a lookup table. Especially since methods, classes, decorators, etc are all first class citizens in Python.