Python doesn't do function overloading. This is a consequence of it being a loosely-typed language. Instead you can specify an unknown number of arguments and deal with their interpretation in the function logic.
There are a couple ways you can do this. You can specify specific optional arguments:
def func1(arg1, arg2=None):
if arg2 != None:
print "%s %s" % (arg1, arg2)
else:
print "%s" % (arg1)
Calling it we get:
>>> func1(1, 2)
1 2
Or you can specify an unknown number of unnamed arguments (i.e. arguments passed in an array):
def func2(arg1, *args):
if args:
for item in args:
print item
else:
print arg1
Calling it we get:
>>> func2(1, 2, 3, 4, 5)
2
3
4
5
Or you can specify an unknown number of named arguments (i.e. arguments passed in a dictionary):
def func3(arg1, **args):
if args:
for k, v in args.items():
print "%s %s" % (k, v)
else:
print arg1
Calling it we get:
>>> func3(1, arg2=2, arg3=3)
arg2 2
arg3 3
You can use these constructions to produce the behaviour you were looking for in overloading.