Everything Is an Object in Python
See proof that every value in Python is an object: integers, functions, classes, modules, types, and even code itself all share the same object foundation.
Learn Python programming from scratch
See proof that every value in Python is an object: integers, functions, classes, modules, types, and even code itself all share the same object foundation.
Understand the Python data model: how protocols and magic methods let your objects work with built-in syntax like len(), +, in, and for loops.
Learn the most important special methods in Python: __str__, __repr__, __eq__, __hash__, __bool__, __call__, __getitem__, and more, with practical examples.
Learn to control attribute access on Python objects with __getattr__, __setattr__, __delattr__, and __getattribute__, plus practical customization patterns.
Learn how Python descriptors work: the __get__, __set__, and __delete__ protocol that powers properties, methods, and attribute access control.
Compare Python properties and descriptors: when to use @property for simple cases and when to reach for a full descriptor class for reusable attribute management.
Learn how Python metaclasses work: using type() to create classes dynamically, writing custom metaclasses, and knowing when metaclasses are the right tool.
Learn dynamic attribute access with getattr(), setattr(), hasattr(), and delattr(). Build object proxies, attribute delegation, and data-driven attribute patterns.
Learn the step-by-step process Python uses to resolve attribute access, from data descriptors to instance dictionaries to __getattr__ fallback.
Learn the most common advanced Python mistakes: mutable defaults, late-binding closures, misuse of metaclasses, and other pitfalls that trip up experienced developers.
Learn to build a production-ready Python library: package structure, public API design, type hints, custom exceptions, descriptors, and metaclasses working together.
Learn how to use the factory pattern in Python to encapsulate object creation, making your code more flexible and easier to extend.