OTHER·중요도 5·2026. 05. 19.·Dev.to
The Protocol Behind Python's Containers
── KO ──────────────────
파이썬의 컨테이너 프로토콜에 대한 설명.
파이썬에서 프로토콜은 명세가 아닌 행동으로 정의되는 비공식 계약입니다. 이 글에서는 iterable과 iterator의 차이를 배우는 것이 중요하며, iterable은 Iterator를 생성할 수 있는 객체입니다. 파이썬의 리스트, 튜플, 문자열, 사전은 이러한 내장 iterable의 예입니다. 글을 통해 구조적 타이핑과 덕 타이핑의 개념도 설명되고 있습니다.
── EN ──────────────────
Explanation of the protocol behind Python's containers.
In Python, a protocol is an informal contract defined by behavior rather than declaration. This article highlights the importance of understanding the difference between an iterable and an iterator. Iterables, such as lists, tuples, strings, and dictionaries, can produce an iterator. Concepts like structural typing and duck typing are also discussed throughout.