๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Python Intermediate

What is Python ABC Module?

The Abstract Base Classes module that enables defining interfaces and abstract methods that subclasses must implement.

The abc module provides infrastructure for defining abstract base classes in Python. Classes inheriting from ABC with methods decorated with @abstractmethod cannot be instantiated directly โ€” subclasses must implement all abstract methods. This enforces interface contracts at instantiation time rather than at method call time. ABCs are used extensively in Python's standard library: collections.abc defines Iterable, Mapping, Sequence interfaces. Custom ABCs enable type checking with isinstance() and designing frameworks where plugins must implement specific methods. The __subclasshook__ method allows virtual subclass registration without actual inheritance.

Related Terms

Pydantic
A data validation library that uses Python type annotations to validate and serialize data with automatic error reporting.
Pandas
A powerful data analysis and manipulation library providing DataFrames and tools for working with structured data.
Django
A high-level web framework that follows the batteries-included philosophy, providing ORM, admin, auth, and more out of the box.
Enum
A built-in class for creating enumerated constants โ€” named groups of related values that improve code readability.
NumPy
A fundamental library for numerical computing in Python, providing efficient multi-dimensional arrays and mathematical operations.
F-String
A formatted string literal prefixed with f that allows embedding Python expressions directly inside curly braces.
View All Python Terms โ†’