객체를 꾸며주는 패턴이다.

예를 들면 meow를 출력하는 Cat 객체가 있을 때

Cat객체를 하트를 붙여주는 데코레이터 객체로 감싸 meow 출력을 꾸며주는 것이다.
class Animal:
def speak(self):
pass
class Cat(Animal):
def speak(self):
print("meow", end='')
class Dog(Animal):
def speak(self):
print("bark", end='')
def makeSpeak(animal:Animal):
animal.speak()
print(" ")
class Deco(Animal):
def __init__(self,animal:Animal):
self.animal = animal
def speak(self):
self.animal.speak()
class WthSmile(Deco):
def speak(self):
self.animal.speak()
print("😀",end='')
class WthHeartEyes(Deco):
def speak(self):
self.animal.speak()
print("😍",end='')

Animal을 상속한 클래스가 들어오고

인수로 Deco가 들어오는 것은

이런 동작으로 볼 수 있다.
