8. Data Types
The modules described in this chapter provide a variety of specialized data types such as dates and times, fixed-type arrays, heap queues, synchronized queues, and sets.
Python also provides some built-in data types, in particular,
dict, list, set and frozenset, and
tuple. The str class is used to hold
Unicode strings, and the bytes class is used to hold binary data.
The following modules are documented in this chapter:
- 8.1.
datetimeBasic date and time types - 8.2.
calendarGeneral calendar-related functions - 8.3.
collectionsContainer datatypes - 8.4.
collections.abcAbstract Base Classes for Containers - 8.5.
heapqHeap queue algorithm - 8.6.
bisectArray bisection algorithm - 8.7.
arrayEfficient arrays of numeric values - 8.8.
weakrefWeak references - 8.9.
typesDynamic type creation and names for built-in types - 8.10.
copyShallow and deep copy operations - 8.11.
pprintData pretty printer - 8.12.
reprlibAlternaterepr()implementation - 8.13.
enumSupport for enumerations- 8.13.1. Module Contents
- 8.13.2. Creating an Enum
- 8.13.3. Programmatic access to enumeration members and their attributes
- 8.13.4. Duplicating enum members and values
- 8.13.5. Ensuring unique enumeration values
- 8.13.6. Using automatic values
- 8.13.7. Iteration
- 8.13.8. Comparisons
- 8.13.9. Allowed members and attributes of enumerations
- 8.13.10. Restricted subclassing of enumerations
- 8.13.11. Pickling
- 8.13.12. Functional API
- 8.13.13. Derived Enumerations
- 8.13.14. Interesting examples
- 8.13.15. How are Enums different?