觀察輸出我們可以發現,使用 weakref.ref() 建立弱引用,物件A 的reference count 沒有變化,依然還是2。 Output of weakref.ref demo. Python.
確定! 回上一頁