Self modifying systems question

Steven Taschuk staschuk at telusplanet.net
Wed Apr 30 10:01:58 EDT 2003


Quoth Sten Kvamme:
> 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.

Others have already shown examples of how Python's intrinsic
dynamism lets you add attributes (including methods) to objects at
runtime.

For a more alarming example, in which a class, at runtime,
rewrites its own source and gets recompiled, see Michele
Simionato's post
    <http://groups.google.com/groups?th=e6cf42cbc54a7420>
from 17 March.

-- 
Steven Taschuk                staschuk at telusplanet.net
"I tried to be pleasant and accommodating, but my head
 began to hurt from his banality."   -- _Seven_ (1996)





More information about the Python-list mailing list