Check if dictionary empty with == {}

Skip Montanaro skip.montanaro at
Thu Aug 20 01:15:09 CEST 2015

Comparison against {} will be less efficient. You need to create a
dictionary every time instead of just checking the length of your
dictionary, which is likely stored in the header. So, it will work, but
certainly isn't idiomatic Python.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list