import sys
class T:
pass
t = T
num = sys.getrefcount(t)
print(num) #测出的个数-1为实际对象个数,此处num的值为2,实际引用的对象个数是1.
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/193593.html
import sys
class T:
pass
t = T
num = sys.getrefcount(t)
print(num) #测出的个数-1为实际对象个数,此处num的值为2,实际引用的对象个数是1.
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/193593.html