282 log.query("%s connected" % self.peerAddr)
283 self.unpickler = get_unpickler(insecure=settings.USE_INSECURE_UNPICKLER)
284
285 def connectionLost(self, reason):286 if reason.check(ConnectionDone):
287 log.query("%s disconnected" % self.peerAddr)
288 else:
There are one (or more) legal parameters for an overridden method that are not legal for an overriding method. This will cause an error when the overriding method is called with a number of parameters that are legal for the overridden method. This violates the Liskov substitution principle. Read more about LSP [here] (https://en.wikipedia.org/wiki/Liskovsubstitutionprinciple).
class A:
def foobar(x, y=0):
return x + y
class B(A):
def foobar(x, y):
return x + 2*y
a = A()
a.foobar(1) # Valid
b = B()
b.foobar(1) # Invalid
class A:
def foobar(x, y=0):
return x + y
class B(A):
def foobar(x, y=1):
return x + 2*y
a = A()
a.foobar(1) # Valid
b = B()
b.foobar(1) # Valid