Package turbogears :: Module decorator
[hide private]

Module decorator

source code

Functions [hide private]
 
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 change signature to accept arbitrary additional arguments.
source code
 
simple_decorator(caller, signature=None)
Decorate function with caller.
source code
 
simple_weak_signature_decorator(caller)
Decorate function with caller and change signature to accept arbitrary additional arguments.
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 [hide private]

decorator(entangler, signature=None)

source code 
Decorate function with entangler.

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

Enables alternative decorator syntax for Python 2.3 as seen in PEAK:

    [my_decorator(foo)]
    def baz():
        pass

Mind, the decorator needs to be a closure for this syntax to work.

weak_signature_decorator(entangler)

source code 
Decorate function with entangler and change signature to accept
arbitrary additional arguments.

Enables alternative decorator syntax for Python 2.3 as seen in PEAK:

    [my_decorator(foo)]
    def baz():
        pass

Mind, the decorator needs to be a closure for this syntax to work.

func_id(func)

source code 

Return identity of function.

Identity is invariant under decorator application (if decorator is created with decorator() or weak_signature_decorator()).