Message119187
import sys
def foo():
x = [o] * 100
raise ArithmeticError
o = "something"
print sys.getrefcount(o)
try:
foo()
except ArithmeticError:
pass
print sys.getrefcount(o)
-------------------------------------------
Gives:
4
104
Looking at the CPython source, FrameObject's deallocator does actually decrement refcounts of its locals and arguments. Guessing that the FrameObject is not being deallocated. |
|
Date |
User |
Action |
Args |
2010-10-20 04:01:48 | James.Bowman | set | recipients:
+ James.Bowman |
2010-10-20 04:01:47 | James.Bowman | set | messageid: <1287547307.96.0.164615718741.issue10150@psf.upfronthosting.co.za> |
2010-10-20 04:01:45 | James.Bowman | link | issue10150 messages |
2010-10-20 04:01:44 | James.Bowman | create | |
|