[sugar] Reloading Python code
Mon Feb 26 09:49:31 EST 2007
On 2/25/07, Andrew Clunis <orospakr at linux.ca> wrote:
> Just a quick introduction: I'm the author of Develop activity, OLPC's
> Python "IDE".
Hi Andrew and the rest of Sugar.
Sorry, I really should have introduced myself as well.
I'm a Python committer and have been for about 5 years. I typically
work across the entire codebase, though tend to focus more on the
interpreter core rather than the Python standard library. I'm an
admin for various Python stuff and helped produce Python 2.5.
I've been interested in OLPC for a long time, but wasn't really sure
how to help out. Ivan gave an inspiring keynote at PyCon and we
managed to sync up. I don't have a ton of time, but I'll probably
work on speeding up the interpreter and generally improving Python in
the OLPC env't. I've got a bunch of ideas how to go about this.
> - From a practical perspective, though, I'm not sure how to implement
> this usefully into Develop.
I'm not entirely sure either. At a high-level, if you modified
something in Develop, then develop were to compile the module (e.g.,
generate a .pyc file) the compiled code could be reloaded in a running
instance. When this reload happens the new code is picked up. With
the current approach, there are many things which could break when
there are advanced features being used (e.g., metaclasses). However,
I suspect that most Python could would work just fine and pick up the
new code and start using it.
Bert also provided a good answer in his follow up.
> Would there be some sort of "merge into running activity" button over a
> buffer, or would there have to be something more drastic, like a
> smalltalk style environment of floating objects and their methods?
> That might prove difficult to implement practically.
Yeah, Guido said he wasn't interested in something that far reaching
either. Right now I think the focus is on creating an 80% solution,
see how that works, then iterate from there.
More information about the Sugar-devel