It seems that ipython can save object references when I don't expect this.
Consider the following script ( grc.py ):
import sys obj = [] print sys.getrefcount(obj)
When I ran it in ipython :
Python 2.7.1 |EPD 7.0-2 (64-bit)| (r271:86832, Nov 29 2010, 13:51:37) In [1]: %run grc.py 2 In [2]: print sys.getrefcount(obj) 4
What's happening? Where did the extra two links come from?
source share