Fastest way to convert a byte of integer into a list

Paul Rubin http
Fri Jul 13 02:28:16 CEST 2007


Godzilla <godzillaismad at gmail.com> writes:
> > num = 255
> > numlist = [num >> i & 1 for i in range(8)]
> 
> Thanks matimus! I will look into it...

numlist = lookup_table[num]

where lookup_table is a precomputed list of lists.



More information about the Python-list mailing list