What's the fastest way to convert a list of booleans into a binary string in python?
e.g. boolList2BinString([True, True, False]) = '0b110'.
Also, how would I convert that binary string into the binary literal? Would this take more time than just converting from the boolean list to the binary literal immediatley? How would one do this?
e.g. boolList2Bin([True, True, False]) = 0b110.
Thanks!
Py_True-- is probably fastest. /s Seriously though, how serious is the "fastest" requirement? Did you add that just because or have you tried something and it was too slow (if so, please add details!).