This seems very similar to https://docs.python.org/3/library/functools.html#functools.singledispatch Am I missing something?