l = ['1', 'a', 'b', '---', '2', 'c', 'd', '---', '3', '123', 'e', '---', '4']
r = []
i = iter(l)
while True:
    a = [x for x in itertools.takewhile(lambda x: x != '---', i)]
if not a:
    break
r.append(a)
print(r)
a list > a list of lists