liveBook · Manning

Abstract method

An abstract method is a method declaration that specifies an operation without providing a complete implementation, requiring concrete subclasses to provide one.

How 3 Manning books explain it

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.

Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains abstract method →

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 →

Build a Multi-Agent System (from Scratch)

An abstract method is a method that concrete subclasses must implement before they can be instantiated.

How it is used
Defines the required interface for tools equipped to an LLM and executed through tool calls.
How deep it goes
Explains abstract properties and methods, then demonstrates a subclass implementation without detailing abstract-method internals.
Examples
Uses a Hailstone tool that implements BaseTool and performs one step of the Hailstone sequence.
What you can do after
Build it from scratch by subclassing BaseTool and implementing its three properties and __call__().

Read how Build a Multi-Agent System (from Scratch) explains abstract method →

Also covered in

What to know first

Related concepts

Questions about abstract method

What is abstract method?

An abstract method is a method declaration that specifies an operation without providing a complete implementation, requiring concrete subclasses to provide one.

Which Manning books explain abstract method?

The Well-Grounded Python Developer: How the pros use Python and Flask, Software Design for Python Programmers and Build a Multi-Agent System (from Scratch).

What should I know before learning abstract method?

Manning books that teach abstract method usually introduce method, object and class first.

What is abstract method a kind of?

Abstract method is a kind of method. A method is a callable function or operation associated with a type, class, or object and invoked through that association.

What is abstract method part of?

Abstract method is part of abstract class. An abstract class is a class designed as a base for subclasses, providing shared structure or behavior and potentially specifying operations subclasses must implement.

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.