Convert a tuple to a named tuple with the star modifier
my_named_tuple = MyNamedTuple(*a_tuple)
From Stack Overflow
More binary/string/decimal operations:
"{0:032b}".format(my_int)
Converts an int into a string of zeroes and ones (32 for 32-bit number).
int(my_string, 2)
Converts a string of zeros and ones into an integer
Discovered the array module for representing homogeneous data.
Also this very neat tip for creating a byte string from an array of integers.
The copy
module provides methods for both shallow and deep copy which allow you to copy mutable structures like dictionaries if you want to avoid mutating dictionaries that are passed to your code.