>>> import sys
>>> sys.getrefcount(a)
82
>>> a = 'hello'
>>> sys.getrefcount(a)
2 # a作为实参传入getrefcount函数中,会进行一次参数复制,引用次数加1。 所以显示的是 2
>>> b = a
>>> sys.getrefcount(a)
3
>>> sys.getrefcount(b)
3
>>> del a
>>> sys.getrefcount(b)
2
标签:getrefcount,sys,del,82,import,getrefcoun From: https://www.cnblogs.com/sangern/p/17470529.html