### Navigation

- index
- modules |
- next |
- previous |
- Python v3.1c2 documentation »
- The Python Standard Library »

# 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. `datetime` — Basic date and time types
  - 8.1.1. Available Types
  - 8.1.2. `timedelta` Objects
  - 8.1.3. `date` Objects
  - 8.1.4. `datetime` Objects
  - 8.1.5. `time` Objects
  - 8.1.6. `tzinfo` Objects
  - 8.1.7. `strftime()` Behavior
- 8.2. `calendar` — General calendar-related functions
- 8.3. `collections` — Container datatypes
  - 8.3.1. ABCs - abstract base classes
  - 8.3.2. `Counter` objects
  - 8.3.3. `deque` objects
    - 8.3.3.1. `deque` Recipes
  - 8.3.4. `defaultdict` objects
    - 8.3.4.1. `defaultdict` Examples
  - 8.3.5. `namedtuple()` Factory Function for Tuples with Named Fields
  - 8.3.6. `OrderedDict` objects
  - 8.3.7. `UserDict` objects
  - 8.3.8. `UserList` objects
  - 8.3.9. `UserString` objects
- 8.4. `heapq` — Heap queue algorithm
  - 8.4.1. Theory
- 8.5. `bisect` — Array bisection algorithm
  - 8.5.1. Examples
- 8.6. `array` — Efficient arrays of numeric values
- 8.7. `sched` — Event scheduler
  - 8.7.1. Scheduler Objects
- 8.8. `queue` — A synchronized queue class
  - 8.8.1. Queue Objects
- 8.9. `weakref` — Weak references
  - 8.9.1. Weak Reference Objects
  - 8.9.2. Example
- 8.10. `types` — Names for built-in types
- 8.11. `copy` — Shallow and deep copy operations
- 8.12. `pprint` — Data pretty printer
  - 8.12.1. PrettyPrinter Objects
  - 8.12.2. pprint Example
- 8.13. `reprlib` — Alternate `repr()` implementation
  - 8.13.1. Repr Objects
  - 8.13.2. Subclassing Repr Objects

### Navigation

- index
- modules |
- next |
- previous |
- Python v3.1c2 documentation »
- The Python Standard Library »