Self modifying systems question

Miki Tebeka tebeka at cs.bgu.ac.il
Wed Apr 30 14:26:34 CEST 2003


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




More information about the Python-list mailing list