[IPython-user] Problem with IPShellEmbed

mike at pcblokes.com mike at pcblokes.com
Tue Feb 1 04:28:41 CST 2005


Quoting Fernando Perez <Fernando.Perez at colorado.edu>:

>[snip..]

> >
> > Basically IPython doesn't play nicely with psyco (psyco hides local
> > variables in functions it's covering).
> > As an experiment try typing ``import pscyo; psyco.full()`` at an IPython
> > command line ! (I *do* get the same result in Python 2.3 and Python 2.4)
>
> OK, I can understand why psyco does that, but it means it's going to be a bit
> unpleasant to make ipython and psyco play well together.  It will take a bit
> of trial and error to identify all the potential breakdown points, and then
> they will need to be wrapped in appropriate exception traps.
>

Right... I'm afraid stack frames are still a deeply black art to me.

Perhaps a better solution would be to put IPython in a 'Psyco proof bubble' ?
Surely IPython doesn't go deeper into the stack than the function/scope that
*called* IPython. So long as the locals are available from this frame we should
be alright ?

So if you can guarantee (by hook or by crook) that we can access that frame ok
everything is fine ? I'm probably being naive of course.......

> I've been looking at your traceback, and it turns out ipython uses itpl()
> calls in quite a few places, and Itpl.itpl() relies on _getframe tricks.  In
> a
> few places, I could probably replace the itpl calls with plain string
> interpolations, the cost is just a clumsier syntax.  But there are places
> where avoiding Itpl altogether would probably require a much deeper rewrite,
> and I'm not even 100% sure it's possible to get to all the functionality of
> ipython without some stack tricks.  IPython really has to be able to manage a
> clean stack to provide much of its user-visible power, and with a
> psyco-mangled one, it's going to be rough going.
>
> I've put up in the testing dir:
>
> http://ipython.scipy.org/dist/testing/
>

I will certainly test the new version and report back on what happens.

Psyco is a common tool, so it would be *better* if IPython could work with it
(or at least around it). If there are any changes to psyco that would help this
then I'm sure Armin would be willing to consider them.

Regards,

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

> a 0.6.11_cvs source tarball which you can try and use.  I've hardened things
> in a few places to try to survive against psyco's stack mangling, but it's
> not
> guaranteed to work.
>
> Let me know how it goes.
>
> Regards,
>
> f
>






More information about the IPython-user mailing list