···6767 for i in range(0, len(l), n):
6868 yield l[i:i + n]
69697070+def parts(l, n):
7171+ """Splits l into n equal parts. Excess (if it exists) returned as the n+1-th."""
7272+ m = len(l) // n
7373+ for i in range(0, n):
7474+ yield l[i*m:(i+1)*m]
7575+7676+ if len(l) % n != 0:
7777+ yield l[m*n:]
7878+70797180def all_unique(lst):
7281 """Returns True if all items in `lst` are unique."""