4.2. 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. We will go over each one in detail in Chapters 5, 6 and 7.

CORE NOTE: Standard types are not classes

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

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.