_lib.decorator

Decorator module, see http://pypi.python.org/pypi/decorator for the documentation.

Module Contents

Classes

Functions

get_init(cls)
class getfullargspec(f)

“A quick and dirty replacement for getfullargspec for Python 2.X”

__init__(f)
__iter__()
get_init(cls)
getargspec(f)

A replacement for inspect.getargspec

class FunctionMaker(func=None, name=None, signature=None, defaults=None, doc=None, module=None, funcdict=None)

An object with the ability to create functions with a given signature. It has attributes name, doc, module, signature, defaults, dict and methods update and make.

__init__(func=None, name=None, signature=None, defaults=None, doc=None, module=None, funcdict=None)
update(func, **kw)

“Update the signature of func with the data in self”

make(src_templ, evaldict=None, addsource=False, **attrs)

“Make a new function from a given template and update the signature”

create(obj, body, evaldict, defaults=None, doc=None, module=None, addsource=True, **attrs)

Create a function from the strings name, signature and body. evaldict is the evaluation dictionary. If addsource is true an attribute __source__ is added to the result. The attributes attrs are added, if any.

decorate(func, caller)

decorate(func, caller) decorates a function using a caller.

decorator(caller, _func=None)

decorator(caller) converts a caller function into a decorator

class ContextManager
__call__(func)

Context manager decorator

__init__(self, g, *a, **k)
__init__(self, g, *a, **k)
append(a, vancestors)

Append a to the list of the virtual ancestors, unless it is already included.

dispatch_on(*dispatch_args)

Factory of decorators turning a function into a generic function dispatching on the given arguments.