Skip to main content
Loading page…
Python Mastery
Chapter 13
Lesson 1 of 4
Objects, Identity & References
Contents
Notes
Tutor
Concept
Everything in Python Is an Object
Loading activity…
Previous
1 / 9
Continue
Contents
Notes
Discussion
Tutor
28 min
9 activities
0 of 9 done
In this lesson
1
Everything in Python Is an Object
2
Tracing Identity with id()
3
is vs == — The Golden Rule
4
Identity vs Equality: Predict the Output
5
The None-Check in Real Code
6
Aliasing Detective
7
Gotcha: id() Can Be Reused
8
Identity & References Quick Check
9
Explain Reference Aliasing
Objectives
Distinguish identity (is) from equality (==) with precision
Explain that variables are names, not boxes, and trace reference aliasing
Reason about the None, True, and False singletons and why 'is None' is correct idiom
Use id() to inspect object identity and explain what the CPython id value represents
Chapter 13 · The Python Data Model & Memory
Objects, Identity & References
Mutability, Hashability & Shared State
Copying: Shallow vs Deep
Memory, Reference Counting & __slots__
Previous: Designing with Objects
Next: Mutability, Hashability & Shared State