> #The mysterious object is now L[0] and the next line shows that it
> doesn't really have a reference (the only one being the list L which
> we have just created)

I think I have identified this mysterious object. I think it's

sage/rings/ring.pyx:1926

cdef dict _is_Field_cache = {}

as introduced in

http://trac.sagemath.org/sage_trac/ticket/11900

with author listed Simon King :-)

In its current implementation, sage.rings.ring.is_Field has a hard-
coded strongly reffed cache, so ring that passes through there will
have eternal life. As it happens, Module(R) will call is_Field(R) in
some branches, which triggered the eternalization.

DONT CACHE SO MUCH!!! It often leads to nasty complications.
IntegerRingMods cache for themselves whether they are fields already
and really, it's their responsibility to answer swiftly if someone
wants to know whether they're a field. And if you absolutely feel an
uncontrollable urge to cache things, at least use weakrefs.

-- 
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org



Reply via email to