[pypy-issue] [issue1249] Itertools.tee not working correctly with pypy?

Armin Rigo tracker at bugs.pypy.org
Sat Sep 1 18:06:37 CEST 2012

Armin Rigo <armin.rigo at gmail.com> added the comment:

In evaluate(), I see that you use weakrefs a lot, and you seem to do very
different things depending on whether weakrefs are still alive or already dead.
 I would need to look more deeply into the code, but it seems to me that it is
enough to cause the behavior under PyPy to not match the behavior under CPython.
 In PyPy, a weakref's target can still be alive even after the object is
supposedly dead, for some unspecified amount of time.

On CPython you get a partially more consistent behavior.  But it is wrong to
rely on it anyway: e.g. if you create circular references between objects A and
B, and there is a pointer from A to C and a weakref from D to C, then on CPython
too the weakref will appear to be alive for an unexpected longer time.

nosy: +arigo

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list