[issue4921] Object lifetime and inner recursive function

2018-09-11 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4921] Object lifetime and inner recursive function

2018-09-10 Thread Eric Wieser
Eric Wieser added the comment: For anyone doing archaeology - this came up on python-dev about a year after this issue was filed: https://mail.python.org/pipermail/python-dev/2009-December/094439.html -- ___ Python tracker

[issue4921] Object lifetime and inner recursive function

2018-02-19 Thread Eric Wieser
Eric Wieser added the comment: Would it be possible for function self-reference cell vars to be weak references? This wouldn't solve the issue for co-recursive inner functions, but would at least prevent reference cycles for the more common case of simple

[issue4921] Object lifetime and inner recursive function

2009-01-12 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: Hello. Sorry if this is noise. I expected __del__ out of function __del__ out of function __del__ out of function on following code, but actually I got out of function out of function out of function __del__ __del__ __del__ Is

[issue4921] Object lifetime and inner recursive function

2009-01-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Since g calls itself in its own scope, it is stored as one of its own cell vars, which creates a reference cycle. a is also part of its reference cycle for the same reason, so it must wait for garbage collection to be reclaimed. If g didn't keep

[issue4921] Object lifetime and inner recursive function

2009-01-12 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: Thank you for explanation. The combination of inner function + method variable was very handy for me, but maybe I should refrain from using it lightly. :-( -- resolution: - invalid status: open - closed

[issue4921] Object lifetime and inner recursive function

2009-01-12 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: A little followup. Attached script q112.py (some puzzle program) ate up my RAM (80MB) and never ran GC while solving. Current python GC looks at the number of GC objects, but GC object like set object can contain many non GC

[issue4921] Object lifetime and inner recursive function

2009-01-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, tracking memory consumption of each container would be better than simpling couting them, but it's much more complicated as well (not to mention that memory consumption can vary, so you must recalculate it periodically...).