## Contents 

• Descriptor HowTo Guide 

Descriptors let objects customize attribute lookup, storage, and deletion. 

This guide has four major sections: 

– Primer 

∗ Simple example: A descriptor that returns a constant 

∗ Dynamic lookups 

∗ Managed attributes 

∗ Customized names 

∗ Closing thoughts 

– Complete Practical Example 

∗ Validator class 

∗ Custom validators 

∗ Practical application 

– Technical Tutorial 

∗ Abstract 

∗ Definition and introduction 

∗ Descriptor protocol 

∗ Overview of descriptor invocation 

∗ Invocation from an instance 

∗ Invocation from a class 

∗ Invocation from super 

∗ Summary of invocation logic 

∗ Automatic name notification 

∗ ORM example 

– Pure Python Equivalents 

∗ Properties 

∗ Functions and methods 

∗ Kinds of methods 

∗ Static methods 

∗ Class methods 

∗ Member objects and __slots__ 

1) The “primer” gives a basic overview, moving gently from simple examples, adding one feature at a time. Start here if you’re new to descriptors. 

2) The second section shows a complete, practical descriptor example. If you already know the basics, start there. 

3) The third section provides a more technical tutorial that goes into the detailed mechanics of how descriptors work. Most people don’t need this level of detail. 

4) The last section has pure Python equivalents for built-in descriptors that are written in C. Read this if you’re 

