On Mon, Apr 2, 2018 at 5:14 AM, Arkadiusz Bulski <arek.bul...@gmail.com> wrote: > Thanks, > timeit gives `not any(key)` same performance as `sum(key)==0`.
Are you timing these on ten-byte keys, or really large keys? For short keys, just use whatever looks most elegant, and don't worry about performance. If the key is actually megabytes long (which seems unlikely, but you did mention it), do your timing tests on megabyte-long keys. ChrisA -- https://mail.python.org/mailman/listinfo/python-list