Home | Trees | Index | Help |
|
---|
Package harold :: Module callabletools |
|
Useful functions and classes for handling callables. NB: those functions are unable to manage built-in methods (so called method-wrappers). Unless specified otherwise, they will raise a C{TypeError} whenever passed such a callable. @var UNBOUNDED: returned by L{max_args} for callable accepting an arbitrary number of arguments. UNBOUNDED is comparable to any integer, and of course always considered greater. Also, most arithmetic operations involving UNBOUNDED will return UNBOUNDED (all except substracting, and dividing/modulo by UNBOUNDED, which are not defined).
Classes | |
---|---|
CallableWrapper |
Base class for wrapping callables. |
_Unbounded |
Function Summary | |
---|---|
function
|
Return the function executed when the given callable is called. |
Return whether the given callable accepts arbitrary keyword arguments. | |
int or UNBOUNDED
|
Return the maximum number of arguments accepted by the given callable. |
int
|
Return the minimum number of arguments accepted by the given callable. |
Return the number of lines of the given function. | |
Return the signature of the given callable. | |
Return the function underlying this callable, and the number of recursions needed to get it. | |
__max(code,
dec)
| |
__min(func,
code,
dec)
|
Variable Summary | |
---|---|
_Unbounded |
UNBOUNDED = UNBOUNDED
|
Function Details |
---|
get_func(a_callable)Return the function executed when the given callable is called. NB: ifa_callable is a class, __init__ is
returned.
|
kw_args(a_callable)Return whether the given callable accepts arbitrary keyword arguments.
|
max_args(a_callable)Return the maximum number of arguments accepted by the given callable.
|
min_args(a_callable)Return the minimum number of arguments accepted by the given callable.
|
nblines(obj)Return the number of lines of the given function.
|
signature(a_callable, include_func=False)Return the signature of the given callable. The signature is a triple(min,max,kw) where:
|
__get_func_and_reclevel(a_callable)Return the function underlying this callable, and the number of recursions needed to get it.
|
Variable Details |
---|
UNBOUNDED
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Dec 18 15:25:58 2006 | http://epydoc.sf.net |