For example:
classFoo:
def__init__(self) ->None:
self.x=42classBar(Foo):
def__init__(self) ->None:
self.y=9000@propertydefx(self) ->int:
print('got x!!!')
returnself.y@x.setterdefx(self, value: int) ->None:
print('set x!!!')
self.y=valueThis should be allowed as it doesn't violate LSP as long as x implements both a getter and a setter of the correct type.
For example:
This should be allowed as it doesn't violate LSP as long as
ximplements both agetterand asetterof the correct type.