Function overloading in Python: Missing

Xolve picture Xolve · Apr 9, 2009 · Viewed 102.1k times · Source

As this says:

http://web.archive.org/web/20090624083829/http://mail.python.org/pipermail/python-list/2003-May/206149.html

Function overloading is absent in Python.

As far as I feel this a big handicap since its also an OO language. Initially I found that unable to differentiate between the argument types was difficult but the dynamic nature of Python made it easy (e.g. list, tuples, strings are much similar).

However counting the number of arguments passed and then doing the job is like an overkill.

Answer

vartec picture vartec · Apr 9, 2009

Now, unless you're trying to write C++ code using Python syntax, what would you need overloading for?

I think it's exactly opposite, overloading is only necessary to make strongly typed languages act more like Python. In Python you have keyword argument, you have *args and **kwargs.

See for example: What is a clean, pythonic way to have multiple constructors in Python?