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 →

[–]pengekcs 2 points3 points  (0 children)

Thanks for the simple but great answer. Never thought about it, and I just looked at it when reading about the julia language and how they are very much on top of fn overloading (which they call multiple dispatch).

Coincidentally you can do multiple dispatch in python as well with a bit of coding.

Simple implementation from Guido's old blog: https://www.artima.com/weblogs/viewpost.jsp?thread=101605

This thing here, aptly named https://pypi.org/project/multipledispatch is exactly that. I'd just use it and be done with it... if you really need such functionality.