Inheritance works when callers can use a subclass through the same contract as its base. An override can reuse the base calculation with super(), but it still has to honor the inputs and outputs callers expect. Composition handles a different relationship: an importer has an audit sink, and the sink can change without making the importer a kind of sink.
You will build both relationships and compare two ways of describing a contract. An abstract base class prevents incomplete implementations from being instantiated. A Protocol describes required members structurally. Its optional runtime check only looks for those members; it doesn't run a static type checker or prove their signatures are correct. Hidden cases include empty input and unrelated objects with the required method.