지 검사하는 과정이 최적화되어 있다. 다만 나열할 수는 있지만, 순서가 없으므로 시퀀스형이 아니다.
set
형
은
3
장에서 자세히 설명한다.
이제부터 이 장을 마칠 때까지 리스트를 대체할 수 있는 여러 시퀀스형을 살펴본다. 먼저 배열
부터 알아보자.
2
.
10
.
1
배열
리스트 안에 숫자만 들어 있다면 배열(
array.array
)이 리스트보다 훨씬 더 효율적이다. 배열
은
pop()
,
insert()
,
extend()
등 가변 시퀀스가 제공하는 연산을 모두 지원하며, 파일에
빠르게 저장하고 ...
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.