Frame hacking

Gabriel Genellina gagsl-py at yahoo.com.ar
Tue Dec 12 16:09:46 EST 2006


On 12 dic, 17:46, "George Sakkis" <george.sak... at gmail.com> wrote:

> I wonder if the following is possible:
>
> def inject_n_call(func, **kwds):
>     '''Call func by first updating its locals with kwds.'''
>
> def f():
>     return x*y
> 

>>> eval(f.func_code, dict(x=3,y=4))
12




More information about the Python-list mailing list