class Data:
def __init__(self, tray=[]):
self._tray = tray
def add(self, item):
self._tray.append(item)
def __repr__(self):
return ', '.join(str(item) for item in self._tray)
data1 = Data()
data1.add('a')
data2 = Data()
print(data2) # 'a'
인자 기본값에 mutable 넣으면 그 기본값 자체가 변할 수 있어 좋지 않음 ㅋㅋ
기본값은 None으로 넣고, 후에 if문에서 처리해야 함
??? ㅋㅋㅋㅋ 저렇게도되네
ㄴ mutable 관련해서 함정이 조온나 많은 것 같음 ㅋㅋㅋㅋ 개놈들 ㅋㅋ
ㄷㄷ - return 0;
???????? - 엔타로 하스켈!