Nathann Cohen wrote: > Oh. Well that explains it: "module global variables are not cleaned > automatically" [1]. > > Copy/paste this code into some Sage module, and you will never see > "Really ?" printed: > > --- > cdef class A: > def __init__(self): > print "HeyA" > def __dealloc__(self): > print "Really?" > > cdef A wtf = A() > --- > > Soooo well. I don't exactly know if we can safely remove > "pari_instance = PariInstance()" from the module and replace > everything by PariInstance(), since I do not know very well how > intensely that is being called O_o
What do you mean by "safely"? There would be some performance penalty if I am not mistaken, but otherwise doing so should be safe. It's not clear to me why at all you want the PARI instance to get deallocated (upon exit) though. (Ok, its __dealloc__() is currently useless otherwise, and shared libraries shouldn't use global variables anyway.) -leif -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.