0
최근에 파이썬에서 dict 서브 클래스를 만들면 속성을 추가 할 수 있다는 것을 알았지 만, dict의 인스턴스에서는 그렇지 않습니다. 즉 :파이썬 dict 서브 클래스 인스턴스가 dict 인스턴스와 다르게 동작 함
class aDict(dict):
pass
myDict = aDict({"name" : "A"})
myDict.color = "red"
print(myDict.color) #"red"
myOtherDict = dict({"name" : "B"})
myOtherDict.color = "green" #"AttributeError: 'dict' object has no attribute color"