#
2.1 Built-in Types

The following sections describe the standard types that are built into the interpreter. These are the numeric types, sequence types, and several others, including types themselves. There is no explicit Boolean type; use integers instead.

Some operations are supported by several object types; in particular, all objects can be compared, tested for truth value, and converted to a string (with the `` ...`` notation). The latter conversion is implicitly used when an object is written by the `print` statement.

Subsections

- 2.1.1 Truth Value Testing
- 2.1.2 Boolean Operations
- 2.1.3 Comparisons
- 2.1.4 Numeric Types
  - 2.1.4.1 Bit-string Operations on Integer Types
- 2.1.5 Sequence Types
  - 2.1.5.1 String Methods
  - 2.1.5.2 String Formatting Operations
  - 2.1.5.3 XRange Type
  - 2.1.5.4 Mutable Sequence Types
- 2.1.6 Mapping Types
- 2.1.7 Other Built-in Types
  - 2.1.7.1 Modules
  - 2.1.7.2 Classes and Class Instances
  - 2.1.7.3 Functions
  - 2.1.7.4 Methods
  - 2.1.7.5 Code Objects
  - 2.1.7.6 Type Objects
  - 2.1.7.7 The Null Object
  - 2.1.7.8 The Ellipsis Object
  - 2.1.7.9 File Objects
  - 2.1.7.10 Internal Objects
- 2.1.8 Special Attributes