Python functools.singledispatch Examples

Ever wanted to write a single function that behaves differently based on the type of its argument? The functools.singledispatch decorator