2 ms·
Don't forget @singledispatch! Every once and a while this tool is glorious for a polymorphic handler. Ie, `process_entity` that will fan-out to `process_movie`
by whalesalad 8y ago
Don't forget @singledispatch! Every once and a while this tool is glorious for a polymorphic handler. Ie, `process_entity` that will fan-out to `process_movie` or `process_tv_show` etc...
I miss it in a Python 2.7 project I am on right now.
Link to the docs: https://docs.python.org/3/library/functools.html#functools.singledispatch https://docs.python.org/3/library/functools.html#functools.s...
It's the same concept as clojure's defmethod.