python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Liskov, optional and derivied classes
I have a hierarchy of classes that starts with:
class Filter(ABC):
pass
...
class SomeFilter(DerivedFromFilter):
pass
Then I have a hierarchy of classes with a method with a parameter that ...
Dirich
Votes: 0
Answers: 0
How can I make this small pseudocode comply with Liskov principle?
Keeping things tidy and simple, here is my initial Java pseudocode as an example:
public abstract class Vehicle {
private String owner;
private id plate;
public removeVehicle()...
BadProgrammer
Votes: 0
Answers: 1
Python liskov substition principle and custom init
I am writing classes with custom init functions that provide async initialization. This all works well, except that when I create a subclass and override the async init function, mypy tells me I am vi...

Aart Stuurman
Votes: 0
Answers: 2
Violation of the LSP-principle using extra constructor parameters in subtypes
I've been reading about the Liskov Substitution Principle when I noticed this answer. It has a Circle and a ColoredCircle type where the constructor of ColoredCircle takes one extra argument; the colo...

Bas
Votes: 0
Answers: 3