liveBook · Manning

Override

Overriding is defining a more specific implementation that replaces inherited behavior for a type or object while preserving the operation’s interface.

How 3 Manning books explain it

Kotlin in Action, 2E

Method overriding is the definition of a subclass member function that replaces an inherited implementation with the same signature.

How it is used
Marks intentional replacements of inherited functions and properties while implementing interfaces or specializing subclasses.
How deep it goes
Explains open and final eligibility, runtime dispatch, interface conflicts, property implementations, and extension-function limits.
Examples
Uses View and Button clicks, competing Clickable and Focusable defaults, user nickname properties, Customer equality, and Point equality.
What you can do after
Apply it to implement interface contracts, specialize explicitly open members, resolve default-method conflicts, and customize object behavior.

Read how Kotlin in Action, 2E explains override →

Software Design for Python Programmers

Method overriding is the definition of a subclass method with the same operation interface as an inherited superclass method, causing the subclass implementation to be selected for subclass instances.

How it is used
Uses overriding to give subclass instances related behavior while preserving a common superclass interface.
How deep it goes
Explains signatures, runtime dispatch, super(), type-hint hazards, and contract concerns without descending into language-runtime internals.
Examples
Demonstrates Item and OrganicItem pricing, then exposes an incompatible operate() override through a TypeError.
What you can do after
Apply it via Python subclass methods, reuse superclass behavior with super(), and diagnose incompatible overrides using runtime failures and type checking.

Read how Software Design for Python Programmers explains override →

Python How-To

Method overriding is the object-oriented technique in which a subclass defines a method with the same name as an inherited method to provide a specialized implementation.

How it is used
Customizes inherited behavior for specialized subclasses and produces meaningful string representations for class instances.
How deep it goes
Defines complete and partial overrides, demonstrates __str__, and traces single-superclass lookup through method resolution order.
Examples
Uses Task.__str__, Supervisor.login, Supervisor.logout, super(), and Class.mro() as concrete demonstrations.
What you can do after
Apply overriding to replace or extend inherited methods and customize printed representations in Python classes.

Read how Python How-To explains override →

Related concepts

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.