[IPython-user] Ironpython

Fernando Perez Fernando.Perez at colorado.edu
Fri Dec 30 09:54:58 CST 2005

jeff sacksteder wrote:
> What would be required to use ipython as a shell for ironpython instead of
> cpython? It appears that ipython uses an external interpreter, correct?

I'm not really sure, as I don't use win32 myself, but I've heard reports that 
ipython can't be used with jython, because it lacks sys._getframe.  Python 
implementations that run on other virtual machines (Jython/IronPython) often 
handle internals in a different manner, and don't expose enough of them for 
ipython to operate.

For example:

abdul[IPython]> grep -n sys._getframe *py
background_jobs.py:160:                frame = sys._getframe(1)
genutils.py:1039:        frame = sys._getframe(1)
genutils.py:1612:        call_frame = sys._getframe().f_back
iplib.py:1277:            call_frame = sys._getframe(stack_depth).f_back
Itpl.py:214:        frame = sys._getframe(1)
Magic.py:275:        caller = sys._getframe(1).f_code.co_name.replace('magic_','')

While I'm sure some of these could be replaced with other functionality, I'm 
not sure we can get rid of all and still get all the benefits of ipython. 
IPython, while being pure python code (no C in there), exercises fairly 
heavily the CPython internals.

I'd love to see ipython working with both of those, but I don't know how hard 
it would be to make it happen, and not being a win32 user myself, I won't be 
able to do that work.  But I'd be at least interested in hearing from anyone 
who knows more about this topic.



More information about the IPython-user mailing list