3 ms·
Multiple dispatch has to be coded by hand in Python, it isn’t a feature of the language.
by fanf2 8y ago
Multiple dispatch has to be coded by hand in Python, it isn’t a feature of the language.
- sametmax 8y agoSorry you are right. We only have single dispatch built in. I never had the use case for more so I confused them.
- jahewson 8y agoPython 3.7 added the ability to use type annotations with the @functools.singledispatch decorator which lets you write functions in a multi-dispatch manner.
- malmaud 8y agoAs the name suggests, that lets you write functions in a single-dispatch manner. That is different from multiple-dispatch.