Right, automatic clearing of circular references is only in Python 3... On Wednesday, December 5, 2018 at 9:06:39 AM UTC-5, E. Madison Bray wrote: > > On Wed, Dec 5, 2018 at 2:57 PM Simon King <simon...@uni-jena.de > <javascript:>> wrote: > > > > > > > > Am Mittwoch, 5. Dezember 2018 13:38:03 UTC+1 schrieb Volker Braun: > >> > >> On Wednesday, December 5, 2018 at 6:52:55 AM UTC-5, Simon King wrote: > >>> > >>> - If there is a reference cycle involving one instance with a __del__ > >>> method, then Python would not apply garbage collection to that > cycle. > >> > >> > >> Python will garbage collect the cycle by not calling __del__ on some of > the cycle members. > > > > > > Has that changed? I recall that in my early days in Sage (when I created > the first version of my group cohomology package) I had to remove some > __del__ method (or change it into a __dealloc__ method), since otherwise > some reference cycles haven't been collected at all. > > There have been some changes in this area, but mostly focus on Python > 3: https://www.python.org/dev/peps/pep-0442/ > > I think it's still true at least on Python 2 that if an object with a > Python-level __del__ method is involved in a reference cycle, then the > cycle still has to be broken manually. >
-- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.