On 2015-08-20 00:15, Skip Montanaro wrote:
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.

Well, that depends on the intention.

Is it checking whether the dictionary is empty, or whether it's an
empty dictionary (and not, say, an empty list)?

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

Reply via email to