On Sun, 01 Apr 2018 19:14:05 +0000, Arkadiusz Bulski wrote:

> Thanks,
> timeit gives `not any(key)` same performance as `sum(key)==0`.


Have you considered what happens when the key is *not* all zeroes?

key = b'\x11'*1000000

any(key) bails out on the first byte. sum(key) has to add a million 
values.




-- 
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to