Python Standard Type Hierarchy Summary
Numbers, collections, callables and singletons are python's standard type hierarchy.
In this article we present you a brief summary of type hierarchy in python programming language.
Numbers in python are divided into integral and non-integral numbers.
- Integral Numbers: Plain Integers, Long Integers & Booleans
- Non-Integral Numbers: Floating point numbers, Complex numbers, Decimals & Fractions
Sequences, sets and maps are collection type in python.
In python sequence can be mutable and immutable types. Mutable sequence can be changed after its creation. Immutable sequence type cannot be changed once it is created.
- Mutable Sequence: Lists
- Immutable Sequence: Tuples, Strings, Unicodes
Like sequence, sets in python can be mutable and immutable types. Mutable sets can be changed after their creation but immutable sets type cannot change once they are created.
- Mutable Sets: Sets
- Immutable Sets: Frozen Sets
In python, there is currently single mapping types: Dictionary
These are those types to which the function call operation can be made:
- User defined function
- Instance Methods
- Class Instances
- Built-in Functions
- Built-in Methods
Singleton type has a single value. Python has following singleton types:
- Ellipsis (...)