+ 2

Python method overloading

Why python don't support method overloading?

21st Jul 2021, 7:25 AM
Kavya N
Kavya N - avatar
5 Answers
+ 4
Thank you Tibor Santa , it helped.
22nd Jul 2021, 11:37 AM
Kavya N
Kavya N - avatar
+ 3
Ask Guido😁 finally it does not need it because function can Accenture anvariable number of arguments
21st Jul 2021, 10:57 AM
Oma Falk
Oma Falk - avatar
+ 3
Method overloading is only meaningful in statically types languages where the same number of arguments can have different types. In Python the type is allocated dynamically, based on the data that is passed to the function, so there can only be a single implementation. In terms of arity (number of arguments) Python already supports varargs and keyword args as well, so if your function signature follows this pattern, you can literally pass any number and type of arguments. def func(*args, **kwargs)
21st Jul 2021, 6:27 PM
Tibor Santa
Tibor Santa - avatar
0
Share your code bit link in thread Description so people can see what's wrong https://www.sololearn.com/post/75089/?ref=app
21st Jul 2021, 7:34 AM
Ipang
0
Hey Sister Kavya Kindly pls Contact me at suvarnapatil19085@gmail.com I want some guidance from you 😅
22nd Jul 2021, 1:14 PM
Rotace
Rotace - avatar