Package turbogears :: Module decorator

Module decorator

source code

Decorator tools

Functions
 
decorate(func, caller, signature=None)
Decorate func with caller.
source code
 
decorator(entangler, signature=None)
Decorate function with entangler.
source code
 
weak_signature_decorator(entangler)
Decorate function with entangler and weak signature.
source code
 
simple_decorator(caller, signature=None)
Decorate function with caller.
source code
 
simple_weak_signature_decorator(caller)
Decorate function with caller and weak signature.
source code
 
make_weak_signature(func)
Change signature to accept arbitrary additional arguments.
source code
 
compose(*decorators)
Compose decorators.
source code
 
func_composition(func)
Return composition (decorator wise) of function.
source code
 
func_original(func)
Return original (undecorated) function.
source code
 
func_id(func)
Return identity of function.
source code
 
func_eq(f, g)
Check if functions are identical.
source code
Function Details

decorate(func, caller, signature=None)

source code 

Decorate func with caller.

Inspired by Michele Simionato's decorator library: http://www.phyast.pitt.edu/~micheles/python/documentation.html

decorator(entangler, signature=None)

source code 

Decorate function with entangler.

Use new signature or preserve original signature if signature is None.

weak_signature_decorator(entangler)

source code 

Decorate function with entangler and weak signature.

Changes signature to accept arbitrary additional arguments.

simple_weak_signature_decorator(caller)

source code 

Decorate function with caller and weak signature.

Changes signature to accept arbitrary additional arguments.

func_id(func)

source code 

Return identity of function.

If decorator was created with decorator() or weak_signature_decorator(), identity is invariant under decorator application.