Issue #17934: Add a clear() method to frame objects, to help clean up expensive details (local variables) and break reference cycles.

This commit is contained in:
Antoine Pitrou 2013-08-05 23:26:40 +02:00
parent c53204b947
commit 58720d6145
10 changed files with 80 additions and 10 deletions

View file

@ -764,7 +764,7 @@ class SizeofTest(unittest.TestCase):
nfrees = len(x.f_code.co_freevars)
extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
ncells + nfrees - 1
check(x, vsize('12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
check(x, vsize('13P3ic' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
# function
def func(): pass
check(func, size('12P'))