Question: The basic idea of what I want to do is:

```
def aFuncion(string = '', dicti = {}):
    if len(str) > 0:
         print 'you gave string as input'
    if len(dicti) > 0:
         print 'you gave a dict as input'

aFunction(string = 'test')
dict['test'] = test
aFunction(dicti = dict)

```

I know this kind of idea is possible in more OO type of languages, but is this also possible in python?

Right now I'm doing 

```
def aFuncion(input):
    if type(input) == str:
         print 'you gave string as input'
    if type(input) == dict:
         print 'you gave a dict as input'

aFunction('test')

```

But I want the difference to be clear when the function is called

Answer: 
The idea of having the same method support different argument types is known as [multiple dispatch or multimethods](http://en.wikipedia.org/wiki/Multiple_dispatch#Python).

To get a good introduction to it, you can read this Guido Van Rossum [article](http://en.wikipedia.org/wiki/Multiple_dispatch#Python) and have a look at PyPi since there are a few [multimethod packages](http://pypi.python.org/pypi?%3Aaction=search&term=multimethod&submit=search) available.
What you have basically works, there's just some trouble with the variable declarations. Here is a working vesrion:

```
def aFunction(str = '', dicti = {}):
    if len(str) > 0:
         print 'you gave string as input'
    if len(dicti) > 0:
         print 'you gave a dict as input'

str = 'test'
dicti = dict([('test', 'test')])
aFunction(str = str)
aFunction(dicti = dicti)
aFunction(str = str, dicti = dicti)
aFunction(dicti = dicti, str = str)

```

puts:

```
you gave string as input
you gave a dict as input
you gave string as input
you gave a dict as input
you gave string as input
you gave a dict as input

```

You can also have non-specific arguments that are sent to the function as both a list and a dictionary (see [What is a clean, pythonic way to have multiple constructors in Python?](https://stackoverflow.com/questions/682504/what-is-a-clean-pythonic-way-to-have-multiple-constructors-in-python) for example).