Chris Angelico wrote:
[] = x # is equivalent to try: next(iter(x)) except StopIteration: pass else: raise ValueError("too many values to unpack (expected 0)")It's a way of asserting that an iterator is exhausted!
But why disallow using () for the same thing? This is a blatant case of outright list-ism! Tuples are being unfairly discriminated against! -- Greg -- https://mail.python.org/mailman/listinfo/python-list