What does = do?
- Track:
- Python Core, Internals, Extensions
- Type:
- Talk
- Level:
- intermediate
- Duration:
- 30 minutes
Abstract
We use assignment all the time in Python. But what really happens when we use an = in our code? The answer is: It depends. In this talk, I'll explore what happens when we assign a value to a variable, when we mutate an existing value, and when we assign to an attribute. Along the way, we'll explore variable scopes, byte codes, and descriptors. By the end of this talk, you'll appreciate all the hard work that the little = sign is doing, and the remarkable stuff that happens behind the scenes when you use it.