### Navigation

- index
- modules |
- next |
- previous |
- Python »
- 3.2.6 Documentation »
- The Python Standard Library »

# 7. 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:

- 7.1. `datetime` — Basic date and time types
  - 7.1.1. Available Types
  - 7.1.2. `timedelta` Objects
  - 7.1.3. `date` Objects
  - 7.1.4. `datetime` Objects
  - 7.1.5. `time` Objects
  - 7.1.6. `tzinfo` Objects
  - 7.1.7. `timezone` Objects
  - 7.1.8. `strftime()` and `strptime()` Behavior
- 7.2. `calendar` — General calendar-related functions
- 7.3. `collections` — Container datatypes
  - 7.3.1. `Counter` objects
  - 7.3.2. `deque` objects
    - 7.3.2.1. `deque` Recipes
  - 7.3.3. `defaultdict` objects
    - 7.3.3.1. `defaultdict` Examples
  - 7.3.4. `namedtuple()` Factory Function for Tuples with Named Fields
  - 7.3.5. `OrderedDict` objects
    - 7.3.5.1. `OrderedDict` Examples and Recipes
  - 7.3.6. `UserDict` objects
  - 7.3.7. `UserList` objects
  - 7.3.8. `UserString` objects
  - 7.3.9. ABCs - abstract base classes
- 7.4. `heapq` — Heap queue algorithm
  - 7.4.1. Basic Examples
  - 7.4.2. Priority Queue Implementation Notes
  - 7.4.3. Theory
- 7.5. `bisect` — Array bisection algorithm
  - 7.5.1. Searching Sorted Lists
  - 7.5.2. Other Examples
- 7.6. `array` — Efficient arrays of numeric values
- 7.7. `sched` — Event scheduler
  - 7.7.1. Scheduler Objects
- 7.8. `queue` — A synchronized queue class
  - 7.8.1. Queue Objects
- 7.9. `weakref` — Weak references
  - 7.9.1. Weak Reference Objects
  - 7.9.2. Example
- 7.10. `types` — Names for built-in types
- 7.11. `copy` — Shallow and deep copy operations
- 7.12. `pprint` — Data pretty printer
  - 7.12.1. PrettyPrinter Objects
  - 7.12.2. Example
- 7.13. `reprlib` — Alternate `repr()` implementation
  - 7.13.1. Repr Objects
  - 7.13.2. Subclassing Repr Objects

### Navigation

- index
- modules |
- next |
- previous |
- Python »
- 3.2.6 Documentation »
- The Python Standard Library »