What would be the most performance efficient way of checking if a bytes is
all zeros? Currently its `key == b'\x00' * len(key)` however, because its
Python 2/3 compatible:

sum(key) == 0 is invalid
key == bytes(len(key)) is invalid

I already considered precomputing the rhs value.
Length of key is unknown, could be few bytes, could be megabytes.

-- 
~ Arkadiusz Bulski
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to