36 lines
540 B
Plaintext
36 lines
540 B
Plaintext
>>> import callback
|
|
>>> print(callback.foo.__doc__)
|
|
r = foo(fun,[fun_extra_args])
|
|
|
|
Wrapper for ``foo``.
|
|
|
|
Parameters
|
|
----------
|
|
fun : call-back function
|
|
|
|
Other Parameters
|
|
----------------
|
|
fun_extra_args : input tuple, optional
|
|
Default: ()
|
|
|
|
Returns
|
|
-------
|
|
r : float
|
|
|
|
Notes
|
|
-----
|
|
Call-back functions::
|
|
|
|
def fun(i): return r
|
|
Required arguments:
|
|
i : input int
|
|
Return objects:
|
|
r : float
|
|
|
|
>>> def f(i): return i*i
|
|
...
|
|
>>> print(callback.foo(f))
|
|
110.0
|
|
>>> print(callback.foo(lambda i:1))
|
|
11.0
|