import struct


ALL_BYTES = {
    i: struct.pack('B', i)
    for i in range(256)
}

import struct


ALL_BYTES = tuple(
    struct.pack('B', i)
    for i in range(256)
)

convert to tuple for byte lookup