On 17 October 2016 at 10:08, Nathaniel Smith <n...@pobox.com> wrote:
> thought I'd send around a draft to see what you think. (E.g., would
> this be something that makes your life easier?)
As a general rule, PyPy's GC behavior is similar to CPython's if we
tweak the program to start a chain of references at a self-referential
object. So for example, consider that the outermost loop of a program
takes the objects like the async generators, and stores them inside
such an object:
def __init__(self, ref):
self.ref = ref
self.myself = self
and then immediately forget that A instance. Then both this A
instance and everything it refers to is kept alive until the next
cyclic GC occurs. PyPy just always exhibits that behavior instead of
only when you start with reference cycles.
So the real issue should not be "how to so something that will make
PyPy happy", or not only---it should be "how to do something that will
make CPython happy even in case of reference cycles". If you don't,
then arguably CPython is slightly broken.
Yes, anything that can reduce file descriptor leaks in Python sounds good to me.
pypy-dev mailing list