Data Types Articles

array — Efficient arrays of numeric values

This module defines an object type which can compactly represent an array of basic values: characters, integers, floating point numbers. Arrays are sequence types and behave very much like lists, except that the type of objects stored in them is constrained. The type is specified at object creation time by using a type code, which is a single character. The following type codes are defined:

bisect — Array bisection algorithm

Source code: Lib/bisect.py

calendar — General calendar-related functions

Source code: Lib/calendar.py

collections — Container datatypes

Source code: Lib/collections/__init__.py

collections.abc — Abstract Base Classes for Containers

Source code: Lib/_collections_abc.py

copy — Shallow and deep copy operations

Source code: Lib/copy.py

datetime — Basic date and time types

Source code: Lib/datetime.py

enum — Support for enumerations

Source code: Lib/enum.py

graphlib — Functionality to operate with graph-like structures

Source code: Lib/graphlib.py

heapq — Heap queue algorithm

Source code: Lib/heapq.py

pprint — Data pretty printer

Source code: Lib/pprint.py

reprlib — Alternate repr() implementation

Source code: Lib/reprlib.py

types — Dynamic type creation and names for built-in types

Source code: Lib/types.py

weakref — Weak references

Source code: Lib/weakref.py

zoneinfo — IANA time zone support

The zoneinfo module provides a concrete time zone implementation to support the IANA time zone database as originally specified in PEP 615. By default, zoneinfo uses the system’s time zone data if available; if no system time zone data is available, the library will fall back to using the first-party tzdata package available on PyPI.