Is there a one-liner or Pythonic (I'm aware that the former doesn't necessarily imply the latter) way to write the following nested loop?
for i in some_list:
for j in i:
# do something
I've tried
import itertools
for i,j in itertools.product(some_list,i):
# do something
but I get a 'reference before assignment error', which makes sense, I think. I've been unable to find an answer to this question so far... Any suggestions? Thanks!