객체지향 프로그래밍에서 ‘프로토콜’이라는 개념은 오래전 스몰토크 시대부터 비공식 인터페이스를
의미했으며, 초창기부터 이 개념은 파이썬의 핵심이었다. 그러나 자료형 힌트에서 프로토콜은 자료형 검사기
가 검증할 수 있게 인터페이스를 정의하는
typing.Protocol
의 서브클래스를 말한다. 이 두 가지 프로토콜
은
13
장에서 다루며, 여기에서는 함수 어노테이션과 관련해서 간단히 알아본다.
‘
PEP
544
-프로토콜: 구조적 서브타이핑 ...
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.