데이터형¶
이 장에서 설명하는 모듈은 날짜와 시간, 고정형 배열, 힙 큐, 데크, 열거형과 같은 다양한 특수 데이터형을 제공합니다.
파이썬은 또한 일부 내장 데이터형, 특히 dict, list, set과 frozenset, tuple을 제공합니다. str 클래스는 유니코드 문자열을 저장하는 데 사용되고, bytes와 bytearray 클래스는 바이너리 데이터를 저장하는 데 사용됩니다.
이 장에서는 다음 모듈에 관해 설명합니다:
datetime— Basic date and time typeszoneinfo— IANA time zone supportcalendar— General calendar-related functionscollections— Container datatypescollections.abc— Abstract Base Classes for Containersheapq— Heap queue algorithmbisect— Array bisection algorithmarray— Efficient arrays of numeric valuesweakref— 약한 참조types— Dynamic type creation and names for built-in typescopy— Shallow and deep copy operationspprint— Data pretty printerreprlib— Alternaterepr()implementationenum— Support for enumerations- 모듈 내용
- 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?
graphlib— Functionality to operate with graph-like structures