What is the function overload?
function overloading is mainly to solve two problems
- Variable parameter types
- Number of variable parameters
In addition, a basic design principle is that only if the function of the two functions is identical except for the parameter type and the number of parameters, then the function overload is used, if the function of two functions is different, then the overload should not be used, but a function with different names should be used.
For question 1, the function is the same, but the parameter types are different, how does python handle it? The answer is no processing, because Python can accept any type of argument, if the function is the same function, then the different parameter types in Python is likely to be the same code, there is no need to make two of different functions.
For question 2, the function is the same, but the number of parameters is different, how does python handle it? The answer is the default parameter, because the function is the same function, then the default parameter must be used.
In summary, problem 1 and Problem 2 have a solution, so Python naturally does not require function overloading.
Reference: Python does not require function overloading
"ZH cheese" Why doesn't python need function overloading?