Self modifying systems question

Sten Kvamme skvamme at as4-2-8.an.g.bonet.se
Wed Apr 30 09:18:03 EDT 2003


Hello,
Thanks to all of you who answered my question.
Is it also possible to save the changes made to an instance in a 
persistant way?

Thanks again,
Sten

On Wednesday, April 30, 2003, at 02:26 PM, Miki Tebeka wrote:

> Hello Sten,
>
>> Self modifying code is a well known technology. Has anyone done this 
>> in
>> Python? What I'm seeking for is examples of software that adds to
>> itself (methods and variables) in runtime. I'd like an instantiated
>> object to
>> be able to add a method to itself.
>>>> class A:
> 	pass
>
>>>> a = A()
>>>> a.f = lambda x: x + 1
>>>> a.f(100)
> 101
>
> HTH.
> Miki
> -- 
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list