Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

        def arginfo(callable):
    """Get information about the arguments of a callable.

    Returns a :class:`inspect.ArgSpec` object as for
    :func:`inspect.getargspec`.

    :func:`inspect.getargspec` returns information about the arguments
    of a function. arginfo also works for classes and instances with a
    __call__ defined. Unlike getargspec, arginfo treats bound methods
    like functions, so that the self argument is not reported.

    arginfo caches previous calls (except for instances with a
    __call__), making calling it repeatedly cheap.

    This was originally inspired by the pytest.core varnames() function,
    but has been completely rewritten to handle class constructors,
    also show other getarginfo() information, and for readability.
    """
    try:
        return arginfo._cache[callable]
    except KeyError:
        # Try to get __call__ function from the cache.
        try:
            return arginfo._cache[callable.__call__]
        except (AttributeError, KeyError):
            pass
    func, cache_key, remove_self = get_callable_info(callable)
    if func is None:
        return inspect.ArgSpec([], None, None, None)
    result = inspect.getargspec(func)
    if remove_self:
        args = result.args[1:]
        result = inspect.ArgSpec(args, result.varargs, result.keywords,
                                 result.defaults)
    arginfo._cache[cache_key] = result
    return result
        


src/r/e/reg-0.6/reg/__init__.py   reg(Download)
from .compose import ListClassLookup, ChainClassLookup, CachingClassLookup
from .generic import generic
from .mapply import mapply, arginfo
from .sentinel import Sentinel
 

src/r/e/reg-HEAD/reg/__init__.py   reg(Download)
from .compose import ListClassLookup, ChainClassLookup, CachingClassLookup
from .generic import generic
from .mapply import mapply, arginfo
from .sentinel import Sentinel