MemotivaStandard library essentials

What is functools.singledispatch?

Standard library essentials

Audio flashcard · 0:13

Nortren·

What is functools.singledispatch?

0:13

Singledispatch is a decorator that turns a function into a generic function whose behavior depends on the type of the first argument. You register implementations for specific types using the register method. It is Python's mechanism for single-argument method overloading.
docs.python.org