sympy/sympy — pull request #8003 by jcrist (2014-09-09 20:37:33+00:00)
Title: Added docstring to lambdified functions

In `lambdify`, symbols are dummified by default, so normal introspection isn't super useful. Also, for iterable args, a flattening step is applied, so information about those is lost as well. This attempts to remedy that by adding a docstring to functions created with lambdify.

If arguments have names, that is used. Otherwise the stack is inspected to determine if the name can be inferred *with certainty*. If there is more than one variable pointing to the object, then the name cannot be
determined with certainty, and 'arg_#', where '#' is the number of the arg is used.

Demo:

```
>>> a, b, c = symbols('a, b, c')
>>> func = lambdify((a, b, c), a + b + c)
>>> print(func.__doc__)
Created with lambdify. Signature:

func(a, b, c)
```