From: Pete Shinners <pete@sh...> - 2006-11-06 16:33:30
Is there an easy way to test if a function is wrapped by a psyco?
Since the function attrs get modified in place, it looks like more than
a simple isinstance()?
Given a psyco'd function, is there a way to get at the original
On Mon, Nov 06, 2006 at 08:33:33AM -0800, Pete Shinners wrote:
> Is there an easy way to test if a function is wrapped by a psyco?
> Since the function attrs get modified in place, it looks like more than
> a simple isinstance()?
> Given a psyco'd function, is there a way to get at the original
> func_code object?
Yes, there is an (internal) function that you can use to check if a
function's func_code was wrapped by Psyco, and retrieve a function
object that looks like the original one:
Help on built-in function unproxycode in module psyco._psyco:
unproxycode(code) -> function object
Return a new copy of the original function that was used to build the
given proxy code object. Raise psyco.error if code is not a proxy.
Get latest updates about Open Source Projects, Conferences and News.