Python Has 14 Primitive Types In 7 Categories With 4 of Them Being Mutable

Pavol Kutaj
1 min readAug 14, 2021

--

The aim of this reference📚 is to display primitive data structures in python.

There is 14 of them. I am using this as a reference to using return types in function annotations.

1. notes

NR | NX CATEGORY | TYPE       | MUTABILITY
---|-------------|------------|-----------
1 | 1x boolean | bool | immutable
2 | 1x text | str | immutable
3 | 1x mapping | dict | _mutable_
4 | 2x set | set | _mutable_
5 | 2x set | frozenset | immutable
6 | 3x numeric | int | immutable
7 | 3x numeric | float | immutable
8 | 3x numeric | complex | immutable
9 | 3x sequence | list | _mutable_
10 | 3x sequence | tuple | immutable
11 | 3x sequence | range | immutable
12 | 3x binary | bytes | immutable
13 | 3x binary | bytearray | _mutable_
14 | 3x binary | memoryview | immutable

2. sources

--

--

No responses yet