> -It would be nice if decorators were passed a function's AST instead
> of a function object. As it is I have to use inspect.getsource to
> retrieve the source for the function in question, and then use
> ast.parse, which is a bit inefficient because the cpython parser has
> to already have done this once before.

It doesn't matter that much though because the Python parser is very
efficient and the decorator is applied only once.

The PyGPU project used this approach when I remember it correctly:

http://www.cs.lth.se/home/Calle_Lejdfors/pygpu/

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to