Abstract method
An abstract method is a method declaration that specifies an operation without providing a complete implementation, requiring concrete subclasses to provide one.
The Well-Grounded Python Developer: How the pros use Python and Flask
An abstract method is a method declaration that specifies an operation for subclasses without providing its implementation.
- How it is used
- Structures shape-rendering classes around shared behavior and subclass-specific drawing operations.
- How deep it goes
- Explains abstract declarations, non-instantiation, subclass implementation, and method overriding through a shape hierarchy.
- Examples
- Uses Shape, Rectangle, Square, and Circle classes in an onscreen drawing application.
- What you can do after
- Build it from scratch by separating shared shape behavior from subclass-specific drawing implementations.
Software Design for Python Programmers
The abstractmethod decorator marks a method as abstract so that concrete subclasses must implement it.
- How it is used
- Enforces implementation contracts while allowing abstract classes to share state and default behavior.
- How deep it goes
- Explains decoration, instantiation restrictions, inheritance, and duplicated algorithm drawbacks through worked Python examples.
- Examples
- Uses MotorVehicle, Car, Truck, and sports classes to demonstrate required methods, shared workflows, overrides, and duplicated algorithms.
- What you can do after
- Build it from scratch by declaring abstract methods with @abstractmethod and implementing every requirement in concrete subclasses.
Read how Software Design for Python Programmers explains abstract method →
Related concepts
- abstract classpart of · An abstract class is a class designed as a base for subclasses, providing shared structure or behavior and potentially specifying operations subclasses must implement.
- property decoratorused by · In Python, the property decorator creates an attribute-like interface to methods that can retrieve, set, or delete an object's managed value.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

