ANN: python-aspects 1.2 released

Stef Mientki stef.mientki at gmail.com
Thu Oct 9 09:21:49 EDT 2008


Antti Kervinen wrote:
> Hello!
>
> aspects.py is a lightweight and low-level library for intercepting
> function calls. Functions and methods (also in Python standard library
> and third party code) can be wrapped so that when they are called, the
> wrap is invoked first. Depending on the wrap, the execution of the
> original function can be omitted, or the function can be called
> arbitrarily many times. Wraps are able to modify the call arguments
> and the return values of wrapped functions and handle
> exceptions. There can be many wraps on the same function. The wraps
> can be enabled, disabled and removed in any order.
>   
thanks Antti,
this is a wonderful tool, I've always been looking for !!

I've a few questions:
- does wrap work correctly with debuggers like pdb and rpdb2 ?
- is there a way to wrap modules, for problem finding with other users 
of my program,
I would log when a module is imported (and it's code is executed) and 
when a module
reaches it's end. I now realize that by calling a global function at the 
end of each module,
that in the debug mode writes a line to a log file.

cheers,
Stef Mientki




More information about the Python-list mailing list