from Section01_SOLID.LiskovSubstitutionPrinciple.Rectangle import Rectangle
from Section01_SOLID.LiskovSubstitutionPrinciple.Square import Square


def use_it(rc):
    w = rc.width
    rc.height = 10  # unpleasant side effect
    expected = int(w * 10)
    print(f'Expected an area of {expected}, got {rc.area}')


rc = Rectangle(2, 3)
use_it(rc)

sq = Square(5)
use_it(sq)

from Section01_SOLID.LiskovSubstitutionPrinciple.Rectangle import Rectangle
from Section01_SOLID.LiskovSubstitutionPrinciple.Square import Square


def use_it(rc):
    w = rc.width
    rc.height = 10  # unpleasant side effect
    expected = int(w * 10)
    print(f'Expected an area of {expected}, got {rc.area}')


rc = Rectangle(2, 3)
use_it(rc)

sq = Square(5)
use_it(sq)

# unpleasant side effect