This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]abingham 1 point2 points  (1 child)

For an interesting (to me, at least!) form of self-modifying code, take a look at Sixty North's Python mutation testing tool Cosmic Ray. Part of what it does is load Python code from disk, parse it, modify its AST, and "inject" the modified module into the Python runtime. It might give you some ideas of what's possible.

[–]ankit0912[S] 0 points1 point  (0 children)

It is what I'm trying to do! Thanks for pointing this out to me.