[Scipy-tickets] [SciPy] #1501: import in member function causes object to persist

SciPy Trac scipy-tickets@scipy....
Tue Aug 23 10:27:37 CDT 2011

#1501: import in member function causes object to persist
 Reporter:  gertjan                     |       Owner:  somebody   
     Type:  defect                      |      Status:  new        
 Priority:  normal                      |   Milestone:  Unscheduled
Component:  Other                       |     Version:  0.8.0      
 Keywords:  import, garbage collection  |  

Comment(by josefpktd):

 If I try this in IDLE, I don't see this (python 2.6, scipy 0.9.0:

 >>> class A:
         def __init__( self ):
                 import scipy
         def __del__( self ):
                 print 'DELETED'

 >>> a = A()
 >>> print 'a'
 >>> del a
 >>> print 'b'

 I see it when I run it as a script.
 But I also see it when the package is multiprocessing (or numpy or sympy
 or scikits.statsmodels) but not with import math

 Maybe it's just a delay in garbage collection with large packages. ?

 It doesn't look like anything scipy specific

Ticket URL: <http://projects.scipy.org/scipy/ticket/1501#comment:1>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list