- Course
- Core Tech
Core Python 3: Custom Attributes and Descriptors
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.
What you'll learn
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 3: 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.
Table of contents
- Version Check | 20s
- How are Python Objects Represented? | 6m 20s
- Dynamic Attribute Initialization | 4m 41s
- Custom Attribute Read Access | 3m 22s
- Preventing Attribute Write Access | 54s
- Preventing Unwanted Recursion | 2m 34s
- Preventing Attribute Deletion | 1m 35s
- Customizing Attribute Storage | 4m 54s
- Using vars() to Access __dict__ | 1m 22s
- Intercepting All Attribute Access | 4m 39s
- Customizing Attribute Writes | 4m 46s
- Built-in Protocols Bypass Attribute Lookup | 2m 39s
About the authors
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.
More Courses by AustinRobert 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.
More Courses by Robert