IDLE's PyShell

Vladimir Marangozov Vladimir.Marangozov at inrialpes.fr
Wed Jul 21 12:11:25 EDT 1999


Tim Peters wrote:
> 
> > I'm very far from this code, so don't blame me for not proposing a
> > patch, but here are two things I experimented with that seem to help
> > partially:
> >
> > 1. Clear the linecache when closing the PyShell window
> 
> Submit a patch!

If I knew where's the appropriate place to put the linecache.clearcache()
function call, I would have submitted a patch. But I don't know very well
the shell logic, so I'll let somebody else do it for me.

Actually, I really don't understand very well how the PyShell works.
Here's another little exercise that causes some weird behavior. If you can
reproduce it, then it's most probably a bug unrelated to my personal install.

1) start a brand new idle.py (the PyShell welcomes you to Pythonland)
2) press RETURN a couple of times (just to warm the linecache ;-)
3) See the contents of the cache dict by typing "PyShell.linecache.cache"
4) Now provoke a name error by typing, say, "bonk"

we get the usual Traceback ... NameError: bonk.
Everything seems to be perfect, until...

5) See again the contents of the cache with PyShell.linecache.cache

I get a huge output, containing the entire PyShell.py source...
With all due respect to PyShell.py, its source shouldn't be there, isn't it?

-- 
       Vladimir MARANGOZOV          | Vladimir.Marangozov at inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252




More information about the Python-list mailing list