You should probably use a chunking generator
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
Then you can feed your list through a generator function that will chunk at the 2nd level lists
def chunk_items(l, n):
for sub_l in l:
yield from chunks(sub_l, n)
Or if you're using python<3.3
def chunk_items(l, n):
for sub_l in l:
for x in chunks(sub_l, n):
yield x
These return a generator, but if you really wanted to turn it into a list.
new_list = [x for x in chunk_items(lst, 3)]
EDIT:
Just saw in your question that you only wanted to chunk in sets of 3 if the length of the sublists were greater than 5, here's how you could modify the chunker to do that.
def chunk_items(l, n=3, m=5):
for sub_l in l:
if len(sub_l) > m:
yield from chunks(sub_l, n)
else:
yield sub_l