I’ve been wondering.. how many bits Python needs for representing an integer number? Unlike C, which has strong types of variable, Python has weak variable typing mechanism. In C, for instance, uint16_t means an integer number which has exactly 16 bits. But, how does Python do it? Hence, after I ‘googled’ a little, I found a documentation about structs module in Python.
“This module performs conversions between Python values and C structs represented as Python strings. This can be used in handling binary data stored in files or from network connections, among other sources. It uses Format Strings as compact descriptions of the layout of the C structs and the intended conversion to/from Python values.”