Python has a dynamism which can give our objects superpowers.
This course will teach you how to implement highly flexible interfaces with
where the attributes of objects are determined on-the-fly, rather than being
determined in advance by classes.
When classes are too rigid, but dictionaries too flexible, you can often find a good trade-off with dynamic objects.
In this course, Core Python: Custom Attributes and Descriptors, you’ll learn to make objects with highly dynamic interfaces.
First, you’ll explore how objects are internally represented in Python. Next, you’ll discover how to customize object attribute access.
Finally, you’ll learn how to define your own descriptors, which form the basis of much of how Python attributes work.
When you’re finished with this course, you’ll have the skills and knowledge of Python object customization needed to produce flexible and expressive code.
Robert Smallshire is a founding director of Sixty North, a software product and consulting business in based in Norway. He has held several senior software architecture and technical management roles, and he is a regular conference speaker. Python is his weapon of choice.
Austin is a founding director of Sixty North, a software consulting,
training, and application development company. He's a native of Texas
but currently lives in Norway where he writes software, runs a local
software interest group, and presents and teaches whenever he can.
Course Overview Hi everyone. I'm Rob Smallshire, and I am here to welcome you to Core Python: Custom Attributes and Descriptors. My coauthor, Austin Bingham, and I are both founders and principal consultants at Sixty North. In this course, we'll be investigating how the attribute look at mechanisms at the heart of the Python object model work and how to customize them to your advantage. Specifically, we're going to see how to add dynamically‑named attributes to our classes, understand how objects store attributes internally, clarify the relationship between instance and class attributes, demonstrate how to use slots to trade dynamism for better memory performance, understand the central role descriptors play in the Python object model, and learn how to write our own custom descriptors. By the end of this course, you'll be able to confidently customize the internals of the Python object model and define powerful, expressive, and elegant interfaces to your own classes. Before beginning this course, you should be familiar with the essentials of the Python language, including functions, classes, modules, decorators, and properties. This course assumes knowledge equivalent to what's presented in Core Python: Functions and Functional Programming and Core Python: Classes and Object‑orientation. We hope you'll join us on this journey to learn more about Python with the Core Python: Custom Attributes and Descriptors course here, at Pluralsight.