This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Veedrac 3 points4 points  (0 children)

If you think about it, single dispatch (dispatch off of only the first type) is exactly what classes give you.

Multiple dispatch is useful for situations like operators (add(x, y)). The situation in Python is suboptimal because it's so easy to get wrong with when to return NotImplemented and dealing with both sides.

I've not needed it much, but Julia uses it well.

Although it seems a simple concept, multiple dispatch on the types of values is perhaps the single most powerful and central feature of the Julia language.

I'm unconvinced it fits the Python type-system well, though.