[pypy-dev] Re: Mode of interaction

Armin Rigo arigo at tunes.org
Mon Apr 11 12:17:35 CEST 2005

Hi Christian,

I am really sorry about everything I said on IRC.  Your _interplevel_cache is
just great, and exactly what was needed.  It's just some combination of
strange bugs that slowly drove me restless yesterday, and IRC tends to amplify
strong feelings like real annoyance in the face of erratic bugs.  In
particular, bugs in PyPy have been generally nicely reproducible so far, so I
was a bit put off.

I was the first to ask for _interplevel_cache, and it's great!  I didn't read
its source code at first because I was busy debugging my hacks in the flow

Some comments I made like the following one:

> [17:03] <arigo> Christian's new _interplevel_cache.py doesn't seem to 
> hold all analysed pieces of code,

was also caused by the fact that I deleted _interplevel_cache.py without also
removing the .pyc file, which as I understood later not only caused gateway.py
to still be able to import the previous cache, but also recreate a .py file
that contained only the new additions.  The result is that after running py.py
I got a .py file with only one piece of known_source.  This is why I thought
that there was a problem along the lines of the cache only storing the last
piece of analysed code.

So all this frustration of mine boils down to this simple "import bug", or
rather this expectation of mine that clearing _interplevel_cache.py was
sufficient to clear the cache.  I tend to think that .pyc files don't exist,
i.e. that they are just an internal caching detail of CPython, and I'm bitten
from time to time by the fact that you can actually import a .pyc file after
the .py file is gone.

I did read your check-in message about double-clicking _interplevel_cache to
self-destruct it, as well as looked in the source and noticed that the .pyc
and .pyo files where also deleted ("very nice to clean them up!" I though, but
not "right, you really have to clean them up too").  But now it is just so
that "rm _interplevel_cache.py" is 4 letters shorter to type than "python
_interplevel_cache.py".  It never occurred to me that gateway.py would still
try to import the .pyc file alone.  I'd like to share my blame for that with
Python's import mecanisms in general.

Sorry again.  I was getting nervous when the 7th strange bug was  '%s' % 12.3
raising a TypeError for no reason I could possibly imagine.  These bugs were
definitely mine, for sure, but the broken way in which I handled the cache
made them worse.  I should have concluded the IRC session by saying that once
the above minor quirk was understood, _interplevel_cache worked great.  I hope
you don't think that I ever considered removing it.  I really needed a way to
say "oops, great, but not RIGHT now while I debug please".  As Samuele pointed
out, that was all that I needed while playing with the flow space.

Again, sorry, all I meant to write down was the behavior I seemed to observe,
in case Samuele had hints for why it was so.  I didn't mean to criticise your
work in front of him.  The code which failed and which I was debugging was


More information about the Pypy-dev mailing list