I run this test (following Armin's example):

# in file a.py
class Foo(object):
    def __del__(self):
        print 'Deleted'

#in file b.py
from a import A
foo=Foo()

#in file c.py
execfile('b.py', {})
execfile('b.py', {})
execfile('b.py', {})
import gc
gc.collect()

running c.py printes
Deleted
Deleted
Deleted

therefore there is NO memory leak.

On Feb 1, 3:08 pm, VP <vtp2...@gmail.com> wrote:
> One question:
> If I define a class externally, and use local_import to import it into
> controller or model, will it have these potential problems or not?

Reply via email to