On Dec 31, 9:45 am, Simon King <simon.k...@uni-jena.de> wrote:
> > The difference between the "del A[1]" and "A.__delitem__(1)" might only be
> > the fact that in the latter case (where more fucntions calls are performed)
> > a gc is triggered whereas its not in the first case, that's just a wild
> > guess though.
>
> That could be it. A garbage collection can (IIRC) occur at any function
> call. I was not aware that "del A[1]" would avoid that function call.

I don't think it guarantees that. It just happens to in this case. The
construction of the tuple that is the key to be looked up can already
trigger a GC. The proper solution for the particular issue here seems
to be that Cython should generate appropriate track/untrack calls as
mandated by http://docs.python.org/2/c-api/gcsupport.html . Obviously
it happens somewhere, they should just make sure that (at the very
least), weakrefs are cleared after the object is untracked.

The other issue is avoiding deletion of non-weakrefs in
TripleDictEraser (basic, atomic objects are fine, but objects that
could hold references to yet other objects are not, as discussed
above).

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to