Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
But you can kind of "overload" a function internally, through if's on the variable type,inside the function. Function arguments and return values have no static type in python by default. Or am I wrong?
-
devios157017yNot sure about Python but you can sort of overload functions in JavaScript to a degree with default arguments.
Heck you *could* actually overload them any way you want. Function arguments are just typeless variables after all. You could check the types of the arguments and reroute it accordingly.
…not that I recommend doing that, just saying you could. :) -
Double-A4347yI really miss static type checking. Seriously how can you even use functions without it. How do you know what parameters it needs and what it returns?
Related Rants
Learning python and JavaScript. I kind of miss function overloading.
undefined
c++
python
function overloading