### Navigation

- index
- modules |
- next |
- previous |
- Python v2.6.4 documentation »
- The Python Standard Library »

# 9. 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` (which along with `frozenset`, replaces the deprecated `sets` module), and `tuple`. The `str` class can be used to handle binary data and 8-bit text, and the `unicode` class to handle Unicode text.

The following modules are documented in this chapter:

- 9.1. `datetime` — Basic date and time types
  - 9.1.1. Available Types
  - 9.1.2. `timedelta` Objects
  - 9.1.3. `date` Objects
  - 9.1.4. `datetime` Objects
  - 9.1.5. `time` Objects
  - 9.1.6. `tzinfo` Objects
  - 9.1.7. `strftime()` Behavior
- 9.2. `calendar` — General calendar-related functions
- 9.3. `collections` — High-performance container datatypes
  - 9.3.1. ABCs - abstract base classes
  - 9.3.2. `deque` objects
    - 9.3.2.1. `deque` Recipes
  - 9.3.3. `defaultdict` objects
    - 9.3.3.1. `defaultdict` Examples
  - 9.3.4. `namedtuple()` Factory Function for Tuples with Named Fields
- 9.4. `heapq` — Heap queue algorithm
  - 9.4.1. Theory
- 9.5. `bisect` — Array bisection algorithm
  - 9.5.1. Examples
- 9.6. `array` — Efficient arrays of numeric values
- 9.7. `sets` — Unordered collections of unique elements
  - 9.7.1. Set Objects
  - 9.7.2. Example
  - 9.7.3. Protocol for automatic conversion to immutable
  - 9.7.4. Comparison to the built-in `set` types
- 9.8. `sched` — Event scheduler
  - 9.8.1. Scheduler Objects
- 9.9. `mutex` — Mutual exclusion support
  - 9.9.1. Mutex Objects
- 9.10. `queue` — A synchronized queue class
  - 9.10.1. Queue Objects
- 9.11. `weakref` — Weak references
  - 9.11.1. Weak Reference Objects
  - 9.11.2. Example
- 9.12. `UserDict` — Class wrapper for dictionary objects
- 9.13. `UserList` — Class wrapper for list objects
- 9.14. `UserString` — Class wrapper for string objects
- 9.15. `types` — Names for built-in types
- 9.16. `new` — Creation of runtime internal objects
- 9.17. `copy` — Shallow and deep copy operations
- 9.18. `pprint` — Data pretty printer
  - 9.18.1. PrettyPrinter Objects
  - 9.18.2. pprint Example
- 9.19. `repr` — Alternate `repr()` implementation
  - 9.19.1. Repr Objects
  - 9.19.2. Subclassing Repr Objects

### Navigation

- index
- modules |
- next |
- previous |
- Python v2.6.4 documentation »
- The Python Standard Library »