checking if a list is empty



Hi,

If I want to check if a list is empty, which is the more pythonic way?

li = []

(1) if len(li) == 0:
....
or
(2) if not li:
....

Thanks,

Laszlo
.