[Edu-sig] Reloading code (was Re: OLPC: first thoughts)
mahs at telcopartners.com
Mon Mar 12 19:00:40 CET 2007
Paul D. Fernhout wrote:
> Thanks for the update. An entire Python compiler to make it work right?
No, the module I linked to is self-contained, although hardly user-friendly, I
concede. I believe that custom-compilation *will* be required to tackle some
corner cases, but I haven't implemented it.
> Wow. I don't use many class methods so I've never noticed this problem.
> Thanks for putting this up, and under the Python license (according to
> the readme).
Yep, Python license.
> Is this in any ways related to PyPy?
No. It's just an update/replacement for the stdlib compiler package which has
several known problems, and which does not support the native Python 2.5 AST.
> In the Jython reload case I have noticed a different problem, which is
> that a method with a call to super__ will fail. ...
Unfortunately, I don't know any details about Jython's implementation, but this
doesn't surprise me.
> I don't believe CPython reloading has any of those problems, since it is
> not doing the kind of reflection Jython does.
No, although it's pretty easy to come up with corner cases to confuse CPython
> When even Visual Basic or C# or Ruby can do this "edit and continue", I
> am worried about Python's future if it does not gain this feature. See
> for example:
I strongly agree. Edit and continue is intuitive for beginners, productive for
experts, and anyway the standard set by competitors.
> Note that I think that even if it was impossible in Python to resume
> from an exception (without major surgery in Python's innards), being
> able to break on the creation of any exception in the debugger, and then
> one by one tell the debugger to ignore some of them based on the type of
> exception or the module it is created in, would probably still be OK
> enough if you could then edit and continue before the exception was
> actually raised. This weaker form of "Edit and continue" would be harder
> to use, but probably still worthwhile given the right IDE tools.
I suspect that this requires a customized interpreter, and that pypy might be
the vehicle to make this happen.
More information about the Edu-sig