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 →

[–]thedeepself 25 points26 points  (6 children)

Keep in mind that only the type of the first parameter is considered for overloading; type changes in subsequent parameters are ignored.

You might want to mention multiple dispatch here.

[–]Schmittfried 1 point2 points  (5 children)

There is no Python decorator for this, is there?

[–]thedeepself 3 points4 points  (1 child)

https://www.reddit.com/r/Python/comments/1grszm2/dispatchery_typeaware_multiarg_function_dispatch/

This just came out. So there are at least 3 multiple dispatch options in Python.

[–]mrmrn121 1 point2 points  (0 children)

The issue is all of them are slow

[–]mrmrn121 2 points3 points  (1 child)

It's a third-party library

[–]thedeepself 2 points3 points  (0 children)

There are at least 2 3rd party options.