Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

Python Objects เมื่อไหร่ถึงเกณฑ์ Garbage Collection?

Python Object หรือ Variable จะมีคุณสมบัติสำหรับ Garbage Collection ทันทีที่ References ทั้งหมดไปยังมัน Out of Scope หรือถูกลบด้วยตนเอง (del x) เราต้องสมมติว่าไม่มี References ไปยัง Object ที่อื่นอีก เพื่อให้ถูก Garbage Collected