Function overloading is the ability to have multiple functions with the same name but with different signatures/implementations. When an overloaded...
For further actions, you may consider blocking this person and/or reporting abuse
Not sure if you are aware of this, but the standard library already provides this functionality in the
typingmodule. You can see the docs hereI believe that the
overloadin thetypingmodule is not how function overloading should be implemented. What it does is it helps us declare functions with the same name and different args but restricts us from invoking them.Since we are not allowed to invoke an
overloaddecorated function it becomes extremely painful to have just one function definition that handles all overloaded behavior and fill it withifs andelses.In this article, I tried to tackle this very situation where we could also invoke an
@overloaddecorated function and thus eradicate the need of having one definition to cover everything.Thanks.