Attributes in Python, which we use dozens of times each day, seem boring, obvious, and not worthy of attention. But it turns out that they're key to the Python language: Every time you say a.b in Python, that little dot is hiding a lot of work, from searching across multiple objects to silently rewriting things. And it turns out that what happens with attributes, while not always obvious to developers, determines a great deal of behavior in the Python language.
In this talk from PyCon US 2022, I discuss what attributes are (and aren't), what Python does when you use a dot (.) in your code, and how you can take advantage of it. I talk about attribute lookup, about inheritance, and about methods vs. functions. I also look into properties, and how they allow us to have attributes that look like data but behave like setters and getters. Finally, I look at the descriptor protocol, which makes so much of Python's functionality possible, including the automatic insertion of "self" as the first argument in method calls.