run time code generation in python

Carlo v. Dango oest at soetu.eu
Thu Oct 16 09:12:13 EDT 2003


On Thu, 9 Oct 2003 11:08:36 -0700, Robert Brewer <fumanchu at amor.org> wrote:

> "Carlo v. Dango" <amigo at fake.not> wrote in
> news:Xns940F929A63B436020206 at 172.16.0.1:
>
>>
>> Hello there. I have found a need to runtime generate a method and
>> instert it into an object instance. The code is a simple forwarding
>> mechanism like


> You can obtain the magic binding to self with the "new" module's
> instancemethod() function.
>
> cf. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/198078

sounds great! many thanks, will have a look at it. I assume that such a 
representation uses less memory than adding a function (an object, right?) 
to an instance...

-carlo


-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/




More information about the Python-list mailing list