class B {}
class A extends B {}
class SumComputer(object):
def __init__(self, a, b):
self.a = a
self.b = b
def transform(self, x):
raise NotImplementedError
def inputs(self):
return range(self.a, self.b)
def compute(self):
return sum(self.transform(value) for value in self.inputs())
class SquareSumComputer(SumComputer):
def transform(self, x):
return x * x
class CubeSumComputer(SumComputer):
def transform(self, x):
return x * x * x
class Person (Animal)
Languages with Inheritance include JavaScript, Python, Java, PHP, TypeScript, Scala, CoffeeScript, Dart, Pug, Groovy, C3, SystemVerilog, Twig, spider, Apex, SpiderBasic, JS++, Speedie, Aardvark, Simula 67
Languages without Inheritance include Lil, progsbase
View all concepts with or missing a hasInheritance measurement
Read more about Inheritance on the web: 1.