Python Descriptors: The Protocol Behind Properties
Learn how Python descriptors work under the hood, powering properties, class methods, and custom attribute access with __get__, __set__, and __delete__.
12 posts · page 1 of 1
Learn how Python descriptors work under the hood, powering properties, class methods, and custom attribute access with __get__, __set__, and __delete__.
Understand the difference between Abstract Base Classes and Protocols in Python. Learn when nominal typing beats structural typing and vice versa.
Learn how to implement the Strategy, Factory, and Observer design patterns in Python using idiomatic constructs like first-class functions and protocols.
Learn JavaScript private class fields with #, static blocks, private methods, and how they compare to closures and WeakMap patterns.
Go beyond basic dataclass usage with post-init processing, field factories, inheritance, frozen instances, and custom serialization.
Understand Python's descriptor protocol, how properties work internally, and how to build reusable validation descriptors.
Demystify Python metaclasses with practical examples. Learn how classes are created, when to use metaclasses, and real-world patterns.
Design C++ classes with constructors, destructors, member initializer lists, and the Rule of Three and Five to manage resources safely.
Design Java classes that hold state and behavior cleanly. Constructors, encapsulation, static vs instance, records, and the equals plus hashCode contract.
Use extends, super, and method overriding without painting yourself into a corner. When to inherit, when to compose, and how sealed types help.
Choose between interfaces and abstract classes with confidence. Default methods, sealed interfaces, functional interfaces, and concrete decision rules.
A practical introduction to Python classes — defining a class, __init__ and self, instance vs class attributes, methods, __repr__, and a first look at inheritance.