> > > if len(a) == 0 or all(i == a[0] for i in a[1:]): > > > You don't need to check the length of the list because if the list is > empty, 'all' will return True anyway. >
Given the structure of the expression passed as an argument to all(), won't you get an IndexError if a is empty without the guard? (Would try it out if I had an interpreter on my phone...) S -- https://mail.python.org/mailman/listinfo/python-list