데이터형¶
이 장에서 설명하는 모듈은 날짜와 시간, 고정형 배열, 힙 큐, 데크, 열거형과 같은 다양한 특수 데이터형을 제공합니다.
파이썬은 또한 일부 내장 데이터형, 특히 dict, list, set과 frozenset, tuple을 제공합니다. str 클래스는 유니코드 문자열을 저장하는 데 사용되고, bytes와 bytearray 클래스는 바이너리 데이터를 저장하는 데 사용됩니다.
이 장에서는 다음 모듈에 관해 설명합니다:
datetime— 기본 날짜와 시간 형calendar— 일반 달력 관련 함수collections— Container datatypescollections.abc— 컨테이너의 추상 베이스 클래스heapq— Heap queue algorithmbisect— 배열 이진 분할 알고리즘array— 효율적인 숫자 배열weakref— 약한 참조types— 동적 형 생성과 내장형 이름copy— 얕은 복사와 깊은 복사 연산pprint— 예쁜 데이터 인쇄기reprlib— 대안repr()구현enum— Support for enumerations- Module Contents
- Creating an Enum
- Programmatic access to enumeration members and their attributes
- Duplicating enum members and values
- Ensuring unique enumeration values
- Using automatic values
- Iteration
- Comparisons
- Allowed members and attributes of enumerations
- Restricted Enum subclassing
- Pickling
- Functional API
- Derived Enumerations
- When to use
__new__()vs.__init__() - Interesting examples
- How are Enums different?