Python Types

Standard Types

Numbers (four separate sub-types) Regular or “Plain” Integer Long Integer
Floating Point Real Number Complex Number String
List Tuple Dictionary

We will also refer to standard types as “primitive data types” in this text because these types represent the primitive data types that Python provides.
In Java, although primitive data types are supported, they usually come in class “wrappers” for which instances are created when a data type is needed. In Python, standard types are not classes, so creating integers and strings does not involve instantiation. That also means that you cannot subclass a standard type either, although there is nothing wrong with wrapping a type around a Python class and modifying a class to what you desire. Python also provides some classes which emulate types and can be subclassed.

Other Built-in Types

Type None File
Function Complex Number Module
Class Class Instance Method

These are some of the other types you will interact with as you develop as a Python programmer.


You may also like...