mrocklin/multipledispatch — pull request #42 by mrocklin (2014-09-17 19:40:49+00:00)
Title: Help

Adds help and source methods to dispatcher that take inputs like the function itself.

```Python
In [1]: from multipledispatch import dispatch

In [2]: @dispatch(int)
...: def foo(x):
...: """ Foo docstring on ints """
...: return x + 1
...:

In [3]: @dispatch(float)
...: def foo(x):
...: """ Foo docstring on floats """
...: return x - 1
...:

In [4]: f(1)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
in ()
----> 1 f(1)

NameError: name 'f' is not defined

In [5]: foo(1)
Out[5]: 2

In [6]: foo.help(1)
Foo docstring on ints

In [7]: foo.source(1)
File:

@dispatch(int)
def foo(x):
""" Foo docstring on ints """
return x + 1
```