Re: garbage collection / cyclic references

2009-03-22 Thread Aaron Brady
On Mar 21, 11:59 am, "andrew cooke" wrote: > Aaron Brady wrote: > > My point is, that garbage collection is able to detect when there are > > no program-reachable references to an object.  Why not notify the > > programmer (the programmer's objects) when that happens?  If the > > object does still

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 1:04 pm, John Nagle wrote: > Aaron Brady wrote: > > Hello, > > > I was reading and Googling about garbage collection, reference > > counting, and the problem of cyclic references. > > > Python's garbage collection module claims to be able to detect and > > break cyclic garbage.  Some ot

Re: garbage collection / cyclic references

2009-03-21 Thread John Nagle
Aaron Brady wrote: Hello, I was reading and Googling about garbage collection, reference counting, and the problem of cyclic references. Python's garbage collection module claims to be able to detect and break cyclic garbage. Some other languages merely prohibit it. Is this the place to ask a

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
Aaron Brady wrote: > My point is, that garbage collection is able to detect when there are > no program-reachable references to an object. Why not notify the > programmer (the programmer's objects) when that happens? If the > object does still have other unreachable references, s/he should be > i

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 10:28 am, Aaron Brady wrote: > On Mar 21, 9:50 am, "andrew cooke" wrote: > > > > > Aaron Brady wrote: > > > On Mar 21, 7:54 am, "andrew cooke" wrote: > > >> they should not be used to do things like flushing and closing > > >> files, for example. > > > What is your basis for this clai

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 9:50 am, "andrew cooke" wrote: > Aaron Brady wrote: > > On Mar 21, 7:54 am, "andrew cooke" wrote: > >> they should not be used to do things like flushing and closing > >> files, for example. > > What is your basis for this claim, if it's not the mere unreliability > > of finalization?

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
andrew cooke wrote: > Aaron Brady wrote: >> On Mar 21, 7:54 am, "andrew cooke" wrote: >>> they should not be used to do things like flushing and closing >>> files, for example. >> What is your basis for this claim, if it's not the mere unreliability >> of finalization? IOW, are you not merely beg

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
Aaron Brady wrote: > On Mar 21, 7:54 am, "andrew cooke" wrote: >> they should not be used to do things like flushing and closing >> files, for example. > What is your basis for this claim, if it's not the mere unreliability > of finalization? IOW, are you not merely begging the question? I'm not

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 7:54 am, "andrew cooke" wrote: > Paul Rubin wrote: > > "andrew cooke" writes: > >> the two dominant virtual machines - .net and the jvm both handle > >> circular > >> references with no problem whatever. > > > AFAIK, they also don't guarantee that finalizers ever run, much less > > run

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
Paul Rubin wrote: > "andrew cooke" writes: >> the two dominant virtual machines - .net and the jvm both handle >> circular >> references with no problem whatever. > > AFAIK, they also don't guarantee that finalizers ever run, much less > run in deterministic order. i think you're right, but i'm m

Re: garbage collection / cyclic references

2009-03-21 Thread Martin v. Löwis
> The actual backend of CPython requires garbage-collected container > types to implement tp_inquiry and tp_clear methods, but user-defined > types apparently aren't required to conform. tp_inquiry doesn't exist, you probably mean tp_traverse. tp_traverse is completely irrelevant for python-define

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 20, 8:12 pm, "andrew cooke" wrote: > Aaron Brady wrote: > > [...] > > > caveats and fragilities?  If free software can do it, why isn't it all > > over the industry?  What disqualifies it from solved-problem status? > > the two dominant virtual machines - .net and the jvm both handle circul

Re: garbage collection / cyclic references

2009-03-20 Thread Paul Rubin
"andrew cooke" writes: > the two dominant virtual machines - .net and the jvm both handle circular > references with no problem whatever. AFAIK, they also don't guarantee that finalizers ever run, much less run in deterministic order. -- http://mail.python.org/mailman/listinfo/python-list

Re: garbage collection / cyclic references

2009-03-20 Thread andrew cooke
Aaron Brady wrote: [...] > caveats and fragilities? If free software can do it, why isn't it all > over the industry? What disqualifies it from solved-problem status? the two dominant virtual machines - .net and the jvm both handle circular references with no problem whatever. this is standard