Thanks, timeit gives `not any(key)` same performance as `sum(key)==0`.
niedz., 1 kwi 2018 o 21:03 użytkownik Kirill Balunov < [email protected]> napisał: > 2018-04-01 20:55 GMT+03:00 Arkadiusz Bulski <[email protected]>: > >> What would be the most performance efficient way of checking if a bytes is >> all zeros? > > > Try `not any(key)` ;) > > With kind regards, > -gdg > -- ~ Arkadiusz Bulski -- https://mail.python.org/mailman/listinfo/python-list
