Browse by Topic
Popular
Popular Posts
Latest
Latest Posts
Python __new__ Metaclass: Class Creation Explained
Understand how __new__ in a metaclass controls class creation, how it differs from __init__, and when to use it for class customization.
Python Custom Metaclass: How to Write and Use One
Learn how to write a custom metaclass in Python: syntax, practical examples, common pitfalls, and when to prefer simpler tools like __init_subclass__.
Python Type Metaclass: How Classes Are Created
How Python's type metaclass creates classes, how to subclass type for custom metaclasses, and when the __init_subclass__ hook is the lighter alternative.
Python Metaclass Basics: Controlling Class Creation
python metaclass basics: Understand Python metaclasses: what they are, how they control class creation, and when to use them for practical code generation and validation.
Python Metaclass: Controlling Class Creation
How Python metaclasses control class creation, when they are useful, and how they differ from class decorators.
How Python's __set_name__ Works in Descriptors
Learn how Python's __set_name__ descriptor method captures the attribute name during class creation, enabling self-aware validators and ORM fields.
Python Custom Descriptor: Controlling Attribute Access
Learn how to build a python custom descriptor to control attribute access, validate values, and reuse logic across classes with the descriptor protocol.
Python Descriptor vs Property: Choosing the Right Attribute Mechanism
Compare Python descriptors and property: how they work, when to use each, and how property is built on the descriptor protocol.
Python Non-Data Descriptors: How They Work and When to Use Them
Understand Python non-data descriptors, how they differ from data descriptors in attribute lookup, and when to use them with practical code examples.
Python Data Descriptors: How They Work and When to Use
Learn how Python data descriptors work, how they differ from non-data descriptors, and when to use them for validation, caching, and cleaner attribute access.