check if bytes is all nulls

Kirill Balunov kirillbalunov at
Sun Apr 1 15:03:06 EDT 2018

2018-04-01 20:55 GMT+03:00 Arkadiusz Bulski <arek.bulski at>:

> What would be the most performance efficient way of checking if a bytes is
> all zeros?

Try `not any(key)` ;)

With kind regards,

More information about the Python-list mailing list