Steve D'Aprano wrote:
> Is there a way to log when the garbage collector finds and collects a
> reference cycle?
>
> I don't care about objects claimed by the reference counter, I only care
> about cycles.
I don't know, and I don't think so. Would a structure like
a --- b --- c
| | |
d
Is there a way to log when the garbage collector finds and collects a reference
cycle?
I don't care about objects claimed by the reference counter, I only care about
cycles.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https:/
Amit Dev wrote:
> The object is not garbage collected, since there appears to be a cycle
> (between method m2 and A). I would expect this to behave the same as
> having another method "def m2(self): self.m1()", but unfortunately its
> not.
> In above case m2 seems to be in a.__dict__ which is cau
Amit Dev wrote:
> Simple question. If I have the following code:
>
> class A:
> def __init__(self, s):
> self.s = s
> self.m2 = m1
>
> def m1(self):
> pass
>
> if __name__ == '__main__':
> a = A("ads")
> a.m1()
> a = None
>
> The object is not garbag
Simple question. If I have the following code:
class A:
def __init__(self, s):
self.s = s
self.m2 = m1
def m1(self):
pass
if __name__ == '__main__':
a = A("ads")
a.m1()
a = None
The object is not garbage collected, since there appears to be a cycle
(b
On Mar 25, 12:12 am, Aaron Brady wrote:
> On Mar 25, 12:11 am, Aaron Brady wrote:
> > Hello,
>
> > I am posting the code I mentioned on Saturday that collects garbage
> > and cyclic garbage in a flattened two-step process. The code takes
> > 122 lines incl. comments, with 100 in tests. It shoul
On Mar 25, 12:11 am, Aaron Brady wrote:
> Hello,
>
> I am posting the code I mentioned on Saturday that collects garbage
> and cyclic garbage in a flattened two-step process. The code takes
> 122 lines incl. comments, with 100 in tests. It should be in a reply
> to this.
>
> My aim is a buffer-l
On Mar 25, 12:11 am, Aaron Brady wrote:
> Hello,
>
> I am posting the code I mentioned on Saturday that collects garbage
> and cyclic garbage in a flattened two-step process. The code takes
> 122 lines incl. comments, with 100 in tests. It should be in a reply
> to this.
>
> My aim is a buffer-l
Hello,
I am posting the code I mentioned on Saturday that collects garbage
and cyclic garbage in a flattened two-step process. The code takes
122 lines incl. comments, with 100 in tests. It should be in a reply
to this.
My aim is a buffer-like object which can contain reference-counted
objects.