ENع
الدرس 28 · Under the hood

Names, objects and references

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

In Python a variable is not a box that holds a value. It is a name in a namespace that refers to an object on the heap, and an object can have many names. Step through a seven-line program, refs.py, and watch the arrows: two names share one list, a change through one name shows through the other, == and is give different answers, and CPython frees the list the moment its last reference goes away.

14 دقيقة8 خطوات5 أسئلةAdvanced
شكل 28 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.