In python I cannot seem to overload the below functions:
#!/usr/bin/env python
import subprocess
def my_function (a) :
subprocess.call(['proc', a])
return;
def my_function (a, b) :
subprocess.call(['proc','-i',a,b])
return;
def my_function (a, b, c, d) :
subprocess.call(['proc','-i',a,b,'-u',c,d])
return;
E.g. when I call with:
mymodules.my_function("a", "b")
I get:
Traceback (most recent call last):
File "sample.py", line 11, in <module>
mymodules.my_function("a", "b")
TypeError: my_function() takes exactly 4 arguments (2 given)
Why does it try to call the function taking 4 arguments?