Browse by Topic

Popular

Latest

Latest Posts

Illustration of Python async await showing coroutines scheduled on an event loop
Python

Python async/await: Coroutines and the Event Loop Explained

Learn how Python async/await works, how to write coroutines, and how the event loop schedules tasks in real applications.

async/awaitasynciocoroutinesevent loop
Illustration of a Python function object with a callable badge, representing the callable() built-in check.
Python

Python callable built-in: How It Works and When to Use It

Understand Python's `callable()` built-in: how it determines callability, practical use cases, edge cases, and performance considerations.

pythoncallablebuilt-in functions__call__
Illustration comparing a Python function and a callable object with a __call__ method, showing their structural difference.
Python

Python Function vs Callable Object: Key Differences

Learn how Python functions and callable objects differ, when to use each, and how implementing `__call__` lets instances carry state.

callable objects__call__function objectspython callables
A Python callable class diagram showing an object with a __call__ method being invoked like a function.
Python

Python Callable Class: Implementing __call__

python callable class: Implement __call__ to make Python classes callable, with practical examples, use cases, and common mistakes to avoid.

callable__call__dunder methodspython objects
Illustration of a Python object with a call button, representing callable objects and the __call__ method.
Python

Python Callable Objects: How to Make Instances Callable

Learn how to make Python instances callable with `__call__`, and see how stateful callable objects work well for callbacks, decorators, and configurable factories.

callable__call__object-orientedfunctions
Diagram illustrating the Python class creation process from class definition to instance instantiation.
Python

Understanding the Python Class Creation Process

python class creation process: Learn how Python creates classes and instances: class body execution, metaclass hooks, __new__, __init__, and when to customize them.

python classesmetaclasses__new____init__
Illustration of a Python class hierarchy where a parent class hook intercepts the creation of a subclass.
Python

Python Subclass Hook: __init_subclass__ in Practice

Learn how Python's __init_subclass__ hook works, when it fires, and how to use it for validation, registration, and attribute injection in your class hierarchies.

__init_subclass____subclasshook__metaclassesabstract base classes
Diagram showing a Python class hierarchy with a hook for subclass initialization
Python

Python __init_subclass__: Customizing Class Creation

Learn how Python's __init_subclass__ hook works, when to use it, and how it differs from metaclasses with practical examples.

PythonMetaclassesClass HooksOOP
Diagram comparing Python metaclass and class decorator hooks during class creation
Python

Python Metaclass vs Class Decorator

python metaclass vs class decorator: Understand when to use a metaclass or a class decorator in Python, how they differ at runtime, and how to choose the right approac...

metaclassclass decoratormetaprogrammingpython
A diagram showing a metaclass __init__ running at class creation time, with a class object being initialized before instances are created.
Python

Python __init__ Metaclass: How It Works

Understand how __init__ in a Python metaclass runs at class creation time, how it differs from instance __init__, and when to use it.

metaclass__init__class creationPython internals