Ever wondered how Python frameworks that seem kind of magical (like Django) actually work? That’s the subject of this tutorial. If you can imagine a Python feature that doesn’t exist, you might be able to invent it yourself using one of Python’s metaprogramming features.
In this tutorial we’ll learn about a few of Python’s powerful metaprogramming features: decorators, descriptors, and metaclasses. These 3 features power many of Python’s interesting internals (property, methods, and abstract base classes for example).
By the end, you'll understand how function and class decorators work, how the property decorator works under the hood, and what controls the creation of a class.