용해 생성할 수 있다. 클래스 데커레이터도 함수지만, 장식된 클래스를 조사하고, 변경하고, 심
지어 다른 클래스로 대체할 수 있다. 끝으로, 메타클래스는 클래스 메타프로그래밍을 하기 위
한 최첨단 도구로, 이미 살펴본 추상 베이스 클래스처럼 특별한 기질이 있는 완전히 새로운 부
류의 클래스를 만들 수 있게 해 준다.
1
메타클래스는 강력하지만, 제대로 사용하기는 어렵다. 클래스 데커레이터는 이와 같은 문제를
상당 부분 해결해 주며 이해하기도 더 쉽다. 게다가 파이썬
3
.
6
은 ‘
PEP
487
–클래스 생성의
더 간단한 커스터마이징
Simpler
customization
of
class
creation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.