dataclass(@dataclass, Python 3.7+)는 주로 데이터를 담는 클래스를 위한 보일러플레이트 메서드를 자동 생성합니다. **__slots__**는 인스턴스별 __dict__를 피함으로써 메모리를 줄이고 속성 접근 속도를 높이는 최적화입니다.
dataclass — 보일러플레이트 제거
dataclasses dataclass
:
():
.x = x; .y = y
():
():
(.x, .y) == (other.x, other.y)
:
x:
y:
p = Point(, )
p
p == Point(, )
